projects
/
project
/
uhttpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f5ee06
)
check for conf.error_handler before using it
author
Felix Fietkau
<nbd@openwrt.org>
Sun, 13 Jan 2013 10:10:50 +0000
(11:10 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Sun, 13 Jan 2013 10:10:50 +0000
(11:10 +0100)
file.c
patch
|
blob
|
history
diff --git
a/file.c
b/file.c
index
a6350eb
..
b2e6ade
100644
(file)
--- a/
file.c
+++ b/
file.c
@@
-699,10
+699,12
@@
void uh_handle_request(struct client *cl)
if (__handle_file_request(cl, url))
return;
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);
}
uh_client_error(cl, 404, "Not Found", "The requested URL %s was not found on this server.", url);
}