summaryrefslogtreecommitdiffhomepage
path: root/src/main.c
diff options
context:
space:
mode:
authorrofl0r <rofl0r@users.noreply.github.com>2020-03-16 13:19:39 +0000
committerrofl0r <rofl0r@users.noreply.github.com>2020-03-16 13:19:39 +0000
commit3230ce0bc2b7d5c1379c358f4e69346d6ed43429 (patch)
tree660e9141accf20fd8d1b61352dde702f2f3f12ed /src/main.c
parent2e02dce0c3de4a231f74b44c34647406de507768 (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/main.c')
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 2963957..fc5ad45 100644
--- a/src/main.c
+++ b/src/main.c
@@ -325,9 +325,9 @@ main (int argc, char **argv)
* in the list of allowed headers, since it is required in a
* HTTP/1.0 request. Also add the Content-Type header since it
* goes hand in hand with Content-Length. */
- if (is_anonymous_enabled ()) {
- anonymous_insert ("Content-Length");
- anonymous_insert ("Content-Type");
+ if (is_anonymous_enabled (config)) {
+ anonymous_insert (config, "Content-Length");
+ anonymous_insert (config, "Content-Type");
}
if (daemonized == TRUE) {