Module Name:    src
Committed By:   mrg
Date:           Thu Jan 30 02:51:41 UTC 2014

Modified Files:
        src/libexec/httpd: bozohttpd.c

Log Message:
move a variable into the scope of its use, where the assignment
has already validated the pointers used.  fixes a bug reported
in private email from dogcow@.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 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.45 src/libexec/httpd/bozohttpd.c:1.46
--- src/libexec/httpd/bozohttpd.c:1.45	Thu Jan  2 08:21:38 2014
+++ src/libexec/httpd/bozohttpd.c	Thu Jan 30 02:51:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.45 2014/01/02 08:21:38 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.46 2014/01/30 02:51:41 mrg Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -1853,7 +1853,6 @@ bozo_http_error(bozohttpd_t *httpd, int 
 	const char *reason = http_errors_long(code);
 	const char *proto = (request && request->hr_proto) ?
 				request->hr_proto : httpd->consts.http_11;
-	const char *hostname = BOZOHOST(httpd, request);
 	int	size;
 
 	debug((httpd, DEBUG_FAT, "bozo_http_error %d: %s", code, msg));
@@ -1873,6 +1872,7 @@ bozo_http_error(bozohttpd_t *httpd, int 
 
 	if (request && request->hr_file) {
 		char *file = NULL;
+		const char *hostname = BOZOHOST(httpd, request);
 
 		/* bozo_escape_html() failure here is just too bad. */
 		file = bozo_escape_html(NULL, request->hr_file);

Reply via email to