Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libpthread_dbg Always set trailing '\0' in td_thr_getnam...
details: https://anonhg.NetBSD.org/src/rev/9ca63192f02a
branches: trunk
changeset: 349026:9ca63192f02a
user: kamil <kamil%NetBSD.org@localhost>
date: Sun Nov 20 21:49:24 2016 +0000
description:
Always set trailing '\0' in td_thr_getname() to compose valid ASCIIZ string
This fixes threads5 in tests/lib/libpthread_dbg
Sponsored by <The NetBSD Foundation>
diffstat:
lib/libpthread_dbg/pthread_dbg.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 1c0ddd826d1f -r 9ca63192f02a lib/libpthread_dbg/pthread_dbg.c
--- a/lib/libpthread_dbg/pthread_dbg.c Sun Nov 20 21:22:14 2016 +0000
+++ b/lib/libpthread_dbg/pthread_dbg.c Sun Nov 20 21:49:24 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pthread_dbg.c,v 1.47 2016/11/20 03:53:47 kamil Exp $ */
+/* $NetBSD: pthread_dbg.c,v 1.48 2016/11/20 21:49:24 kamil Exp $ */
/*-
* Copyright (c) 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_dbg.c,v 1.47 2016/11/20 03:53:47 kamil Exp $");
+__RCSID("$NetBSD: pthread_dbg.c,v 1.48 2016/11/20 21:49:24 kamil Exp $");
#define __EXPOSE_STACK 1
@@ -280,6 +280,9 @@
name, (size_t)MIN(PTHREAD_MAX_NAMELEN_NP, len))) != 0)
return val;
+ if (len < PTHREAD_MAX_NAMELEN_NP)
+ name[len - 1] = '\0';
+
return 0;
}
Home |
Main Index |
Thread Index |
Old Index