diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-03-16 13:19:39 +0000 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-03-16 13:19:39 +0000 |
commit | 3230ce0bc2b7d5c1379c358f4e69346d6ed43429 (patch) | |
tree | 660e9141accf20fd8d1b61352dde702f2f3f12ed /src/anonymous.h | |
parent | 2e02dce0c3de4a231f74b44c34647406de507768 (diff) |
anonymous: fix segfault loading config item
unlike other functions called from the config parser code,
anonymous_insert() accesses the global config variable rather than
passing it as an argument. however the global variable is only set
after successful loading of the entire config.
we fix this by adding a conf argument to each anonymous_* function,
passing the global pointer in calls done from outside the config
parser.
fixes #292
Diffstat (limited to 'src/anonymous.h')
-rw-r--r-- | src/anonymous.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/anonymous.h b/src/anonymous.h index 0ca980e..6fc4518 100644 --- a/src/anonymous.h +++ b/src/anonymous.h @@ -21,8 +21,8 @@ #ifndef _TINYPROXY_ANONYMOUS_H_ #define _TINYPROXY_ANONYMOUS_H_ -extern short int is_anonymous_enabled (void); -extern int anonymous_search (const char *s); -extern int anonymous_insert (const char *s); +extern short int is_anonymous_enabled (struct config_s *conf); +extern int anonymous_search (struct config_s *conf, const char *s); +extern int anonymous_insert (struct config_s *conf, const char *s); #endif |