Module Name: src
Committed By: reinoud
Date: Mon Mar 23 12:49:29 UTC 2009
Modified Files:
src/libexec/httpd: bozohttpd.c
Log Message:
Fix redirection core dump as reported in PR#41042.
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/libexec/httpd/bozohttpd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.10 src/libexec/httpd/bozohttpd.c:1.11
--- src/libexec/httpd/bozohttpd.c:1.10 Mon Feb 9 17:06:11 2009
+++ src/libexec/httpd/bozohttpd.c Mon Mar 23 12:49:28 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.c,v 1.10 2009/02/09 17:06:11 joerg Exp $ */
+/* $NetBSD: bozohttpd.c,v 1.11 2009/03/23 12:49:28 reinoud Exp $ */
/* $eterna: bozohttpd.c,v 1.142 2008/03/03 03:36:11 mrg Exp $ */
@@ -1327,12 +1327,12 @@
int query = 0;
if (url == NULL) {
- if (asprintf(&urlbuf, "%s/", request->hr_file) < 0)
+ if (asprintf(&urlbuf, "/%s/", request->hr_file) < 0)
error(1, "asprintf");
url = urlbuf;
}
- if (strlen(request->hr_query)) {
+ if (request->hr_query && strlen(request->hr_query)) {
query = 1;
}