diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-13 11:10:50 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-13 11:10:50 +0100 |
commit | bb64de8897d9de5c964d021d05999bd4ca5cb36a (patch) | |
tree | 6cf3be61389481023d8dc11704582f3b8610fca0 | |
parent | 3f5ee063743e34d73c449b0e183f7e8a7a620f4a (diff) |
check for conf.error_handler before using it
-rw-r--r-- | file.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -699,10 +699,12 @@ void uh_handle_request(struct client *cl) if (__handle_file_request(cl, url)) return; - error_handler = alloca(strlen(conf.error_handler) + 1); - strcpy(error_handler, conf.error_handler); - if (__handle_file_request(cl, error_handler)) - return; + if (conf.error_handler) { + error_handler = alloca(strlen(conf.error_handler) + 1); + strcpy(error_handler, conf.error_handler); + if (__handle_file_request(cl, error_handler)) + return; + } uh_client_error(cl, 404, "Not Found", "The requested URL %s was not found on this server.", url); } |