Module Name: src
Committed By: fox
Date: Sun Jun 7 23:33:02 UTC 2020
Modified Files:
src/libexec/httpd: bozohttpd.c
Log Message:
libexec/httpd: Fix the possible -Werror=stringop-truncation
Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.
Reviewed by: kamil@, mrg@
To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 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.113 src/libexec/httpd/bozohttpd.c:1.114
--- src/libexec/httpd/bozohttpd.c:1.113 Thu Feb 28 09:16:42 2019
+++ src/libexec/httpd/bozohttpd.c Sun Jun 7 23:33:02 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: bozohttpd.c,v 1.113 2019/02/28 09:16:42 mrg Exp $ */
+/* $NetBSD: bozohttpd.c,v 1.114 2020/06/07 23:33:02 fox Exp $ */
/* $eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $ */
@@ -496,7 +496,7 @@ got_proto_09:
if (strncasecmp(proto, "HTTP/", 5) != 0)
goto bad;
- strncpy(majorstr, proto + 5, sizeof majorstr);
+ strncpy(majorstr, proto + 5, sizeof(majorstr)-1);
majorstr[sizeof(majorstr)-1] = 0;
minorstr = strchr(majorstr, '.');
if (minorstr == NULL)