Module Name:    src
Committed By:   christos
Date:           Fri Oct 30 23:21:05 UTC 2015

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

Log Message:
- don't use alloca and then check if alloca returns null and then try to
  free it. Allocating from the stack does not return null, and freeing it
  will have unpredictable results. use malloc instead.
- now we are using malloc remove -Wno-stack-protector kludge


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/libexec/httpd/Makefile
cvs rdiff -u -r1.67 -r1.68 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/Makefile
diff -u src/libexec/httpd/Makefile:1.25 src/libexec/httpd/Makefile:1.26
--- src/libexec/httpd/Makefile:1.25	Fri Oct 30 14:53:26 2015
+++ src/libexec/httpd/Makefile	Fri Oct 30 19:21:05 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.25 2015/10/30 18:53:26 tron Exp $
+#	$NetBSD: Makefile,v 1.26 2015/10/30 23:21:05 christos Exp $
 #
 #	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
 #
@@ -48,9 +48,6 @@ CPPFLAGS+=	-DHAVE_NBUTIL_H
 LDADD+=		-lnbutil
 .endif
 
-COPTS.bozohttpd.c=	-Wno-stack-protector
-
-
 .include <bsd.own.mk>
 
 .if ${MKCRYPTO} != "no"

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.67 src/libexec/httpd/bozohttpd.c:1.68
--- src/libexec/httpd/bozohttpd.c:1.67	Wed Oct 28 05:20:15 2015
+++ src/libexec/httpd/bozohttpd.c	Fri Oct 30 19:21:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.67 2015/10/28 09:20:15 shm Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.68 2015/10/30 23:21:05 christos Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -1946,7 +1946,7 @@ bozo_http_error(bozohttpd_t *httpd, int 
 			else
 				user_alloc = 1;
 			/* expand username to ~user/ */
-			user = alloca(strlen(user_escaped) + 3);
+			user = malloc(strlen(user_escaped) + 3);
 			if (user != NULL) {
 				strcpy(user, "~");
 				strcat(user, user_escaped);

Reply via email to