Source-Changes-HG archive

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

[src/trunk]: src/libexec/httpd avoid passing NULL pointers to printf() like f...



details:   https://anonhg.NetBSD.org/src/rev/15df86975dc7
branches:  trunk
changeset: 938267:15df86975dc7
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Sep 05 13:38:24 2020 +0000

description:
avoid passing NULL pointers to printf() like functions and %s.

diffstat:

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

diffs (27 lines):

diff -r 896c8d92d586 -r 15df86975dc7 libexec/httpd/bozohttpd.c
--- a/libexec/httpd/bozohttpd.c Sat Sep 05 13:37:59 2020 +0000
+++ b/libexec/httpd/bozohttpd.c Sat Sep 05 13:38:24 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bozohttpd.c,v 1.120 2020/08/20 07:57:01 mrg Exp $      */
+/*     $NetBSD: bozohttpd.c,v 1.121 2020/09/05 13:38:24 mrg Exp $      */
 
 /*     $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $      */
 
@@ -317,7 +317,7 @@
 
        debug((httpd, DEBUG_FAT,
                "url: method: \"%s\" file: \"%s\" query: \"%s\" proto: \"%s\"",
-               *method, *file, *query, *proto));
+               *method, *file, *query ? *query : "", *proto ? *proto : ""));
 }
 
 /*
@@ -771,7 +771,7 @@
 
                        val = bozostrnsep(&str, ":", &len);
                        debug((httpd, DEBUG_EXPLODING, "read_req2: after "
-                           "bozostrnsep: str `%s' val `%s'", str, val));
+                           "bozostrnsep: str `%s' val `%s'", str, val ? val : ""));
                        if (val == NULL || len == -1) {
                                bozo_http_error(httpd, 404, request, "no header");
                                goto cleanup;



Home | Main Index | Thread Index | Old Index