Module Name: src
Committed By: mrg
Date: Sat Sep 5 13:38:24 UTC 2020
Modified Files:
src/libexec/httpd: bozohttpd.c
Log Message:
avoid passing NULL pointers to printf() like functions and %s.
To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 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/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.120 src/libexec/httpd/bozohttpd.c:1.121
--- src/libexec/httpd/bozohttpd.c:1.120 Thu Aug 20 07:57:01 2020
+++ src/libexec/httpd/bozohttpd.c Sat Sep 5 13:38:24 2020
@@ -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 @@ parse_request(bozohttpd_t *httpd, char *
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 @@ bozo_read_request(bozohttpd_t *httpd)
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;