Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Verify that the terminating '\0', too, is initialized.



details:   https://anonhg.NetBSD.org/src/rev/98da7bfefce1
branches:  trunk
changeset: 746615:98da7bfefce1
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Apr 03 18:26:14 2020 +0000

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

diffstat:

 sys/kern/subr_msan.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 8845b254dbc1 -r 98da7bfefce1 sys/kern/subr_msan.c
--- a/sys/kern/subr_msan.c      Fri Apr 03 18:12:39 2020 +0000
+++ b/sys/kern/subr_msan.c      Fri Apr 03 18:26:14 2020 +0000
@@ -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 @@
        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 @@
        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 *));



Home | Main Index | Thread Index | Old Index