summaryrefslogtreecommitdiff
path: root/libexec/httpd
diff options
context:
space:
mode:
authorleot <leot@NetBSD.org>2018-12-15 09:28:27 +0000
committerleot <leot@NetBSD.org>2018-12-15 09:28:27 +0000
commitfdd008b76e0331b179eca0312d8843f3c71ecc62 (patch)
tree39a71e348b0c7074a690a1716533f3081509cd9c /libexec/httpd
parent7d68719395ff367384d80cccf893261b96c27ad9 (diff)
Avoid possible NULL dereference when sending a big request that timeout.
Problem reported by <maya> and reviewed by <maya> and <mrg>, thanks!
Diffstat (limited to 'libexec/httpd')
-rw-r--r--libexec/httpd/bozohttpd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libexec/httpd/bozohttpd.c b/libexec/httpd/bozohttpd.c
index 2f72969049a..e0777ca27a7 100644
--- a/libexec/httpd/bozohttpd.c
+++ b/libexec/httpd/bozohttpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.c,v 1.103 2018/12/15 02:03:24 maya Exp $ */
+/* $NetBSD: bozohttpd.c,v 1.104 2018/12/15 09:28:27 leot Exp $ */
/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */
@@ -2260,7 +2260,8 @@ bozo_http_error(bozohttpd_t *httpd, int code, bozo_httpreq_t *request,
if (request && request->hr_allow)
bozo_printf(httpd, "Allow: %s\r\n", request->hr_allow);
/* RFC 7231 (HTTP/1.1) 6.5.7 */
- if (code == 408 && request->hr_proto == httpd->consts.http_11)
+ if (code == 408 && request &&
+ request->hr_proto == httpd->consts.http_11)
bozo_printf(httpd, "Connection: close\r\n");
bozo_printf(httpd, "\r\n");
/* According to the RFC 2616 sec. 9.4 HEAD method MUST NOT return a