Last change
on this file since 65a14e5 was
bdd8519,
checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago
|
#988 use-after-free in json configuration parser
The cfg structure stores pointers to the string in this json tree. Do not
release the json tree, keep it as field in the cfg structure.
|
-
Property mode set to
100644
|
File size:
657 bytes
|
Line | |
---|
1 | #ifndef _OG_SERVER_CFG_H |
---|
2 | #define _OG_SERVER_CFG_H |
---|
3 | |
---|
4 | struct og_server_cfg { |
---|
5 | struct { |
---|
6 | const char *user; |
---|
7 | const char *pass; |
---|
8 | const char *ip; |
---|
9 | unsigned int port; |
---|
10 | const char *name; |
---|
11 | } db; |
---|
12 | struct { |
---|
13 | const char *ip; |
---|
14 | const char *port; |
---|
15 | const char *api_token; |
---|
16 | } rest; |
---|
17 | struct { |
---|
18 | const char *interface; |
---|
19 | } wol; |
---|
20 | json_t *json; |
---|
21 | }; |
---|
22 | |
---|
23 | int parse_json_config(const char *filename, struct og_server_cfg *cfg); |
---|
24 | void from_json_to_legacy(struct og_server_cfg *cfg); |
---|
25 | |
---|
26 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.