diff options
| author | christos <christos@NetBSD.org> | 2015-10-30 23:21:05 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-10-30 23:21:05 +0000 |
| commit | d4b0d7e362eb2d7cd1daad1f47e370fa4059e82e (patch) | |
| tree | 2a895c657548181dace035c2509f9bebe1e963c7 /libexec/httpd | |
| parent | f0369b46b1ffe8dfcdd278533e38c75ee011f70d (diff) | |
- 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
Diffstat (limited to 'libexec/httpd')
| -rw-r--r-- | libexec/httpd/Makefile | 5 | ||||
| -rw-r--r-- | libexec/httpd/bozohttpd.c | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/libexec/httpd/Makefile b/libexec/httpd/Makefile index e2eab48a34a..7541b241ced 100644 --- a/libexec/httpd/Makefile +++ b/libexec/httpd/Makefile @@ -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" diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c index 5b060f3aefa..42f6a18c548 100644 --- a/libexec/httpd/bozohttpd.c +++ b/libexec/httpd/bozohttpd.c @@ -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 code, bozo_httpreq_t *request, 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); |
