Module Name:    src
Committed By:   maxv
Date:           Fri Apr  3 18:26:14 UTC 2020

Modified Files:
        src/sys/kern: subr_msan.c

Log Message:
Verify that the terminating '\0', too, is initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/subr_msan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_msan.c
diff -u src/sys/kern/subr_msan.c:1.8 src/sys/kern/subr_msan.c:1.9
--- src/sys/kern/subr_msan.c:1.8	Sat Feb 22 20:08:39 2020
+++ src/sys/kern/subr_msan.c	Fri Apr  3 18:26:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $	*/
+/*	$NetBSD: subr_msan.c,v 1.9 2020/04/03 18:26:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.9 2020/04/03 18:26:14 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -778,7 +778,7 @@ kmsan_strchr(const char *s, int c)
 	char *ret;
 
 	kmsan_check_arg(sizeof(s) + sizeof(c), "strchr():args");
-	kmsan_shadow_check(s, __builtin_strlen(s), "strchr():arg1");
+	kmsan_shadow_check(s, __builtin_strlen(s) + 1, "strchr():arg1");
 	ret = __builtin_strchr(s, c);
 
 	kmsan_init_ret(sizeof(char *));
@@ -791,7 +791,7 @@ kmsan_strrchr(const char *s, int c)
 	char *ret;
 
 	kmsan_check_arg(sizeof(s) + sizeof(c), "strrchr():args");
-	kmsan_shadow_check(s, __builtin_strlen(s), "strrchr():arg1");
+	kmsan_shadow_check(s, __builtin_strlen(s) + 1, "strrchr():arg1");
 	ret = __builtin_strrchr(s, c);
 
 	kmsan_init_ret(sizeof(char *));

Reply via email to