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
This commit is contained in:
rofl0r committed 2020-03-16 13:19:39 +00:00
1 parent 2e02dce0c3
commit 3230ce0bc2
5 files changed
+20 -20

No files matched your search

+3 -3
View File
@@ -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