diff options
author | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-12 21:00:17 +0100 |
---|---|---|
committer | rofl0r <rofl0r@users.noreply.github.com> | 2020-09-12 21:38:04 +0100 |
commit | 4847d8cdb3bfd9b30a10bfed848174250475a69b (patch) | |
tree | 8b5286b2697b10a71511b9849c500254d52f6ceb /src/html-error.c | |
parent | df9074db6e68fbf7847fab0bc33b3a3c9a94620d (diff) |
add_new_errorpage(): fix segfault accessing global config
another fallout of the config refactoring finished by
2e02dce0c3de4a231f74b44c34647406de507768.
apparently no one using the ErrorFile directive used git master
during the last months, as there have been no reports about this issue.
Diffstat (limited to 'src/html-error.c')
-rw-r--r-- | src/html-error.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/html-error.c b/src/html-error.c index c94dbd7..d643aaa 100644 --- a/src/html-error.c +++ b/src/html-error.c @@ -37,17 +37,18 @@ #define ERRORNUM_BUFSIZE 8 /* this is more than required */ #define ERRPAGES_BUCKETCOUNT 16 -int add_new_errorpage (char *filepath, unsigned int errornum) +int add_new_errorpage (struct config_s *conf, char *filepath, + unsigned int errornum) { char errornbuf[ERRORNUM_BUFSIZE]; - config->errorpages = hashmap_create (ERRPAGES_BUCKETCOUNT); - if (!config->errorpages) + conf->errorpages = hashmap_create (ERRPAGES_BUCKETCOUNT); + if (!conf->errorpages) return (-1); snprintf (errornbuf, ERRORNUM_BUFSIZE, "%u", errornum); - if (hashmap_insert (config->errorpages, errornbuf, + if (hashmap_insert (conf->errorpages, errornbuf, filepath, strlen (filepath) + 1) < 0) return (-1); |