Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/httpd Avoid possible NULL dereference when sending a...



details:   https://anonhg.NetBSD.org/src/rev/89f924e0dc05
branches:  trunk
changeset: 446708:89f924e0dc05
user:      leot <leot%NetBSD.org@localhost>
date:      Sat Dec 15 09:28:27 2018 +0000

description:
Avoid possible NULL dereference when sending a big request that timeout.

Problem reported by <maya> and reviewed by <maya> and <mrg>, thanks!

diffstat:

 libexec/httpd/bozohttpd.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 7f919ef2d598 -r 89f924e0dc05 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Sat Dec 15 07:38:58 2018 +0000
+++ b/libexec/httpd/bozohttpd.c Sat Dec 15 09:28:27 2018 +0000
@@ -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 @@
        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



Home | Main Index | Thread Index | Old Index