summaryrefslogtreecommitdiff
path: root/lib/libbluetooth
diff options
context:
space:
mode:
authorplunky <plunky@NetBSD.org>2011-07-07 10:44:50 +0000
committerplunky <plunky@NetBSD.org>2011-07-07 10:44:50 +0000
commite73a7539bbf33b273506bbd0496f27238c1b7e48 (patch)
treef8fe47649b2d4eb647c1422c3caca3662e27a6f4 /lib/libbluetooth
parentf83ecd53dfdda59df3e115100fc0c84e944e8ad1 (diff)
ensure that the buffer is nul-terminated, otherwise printing an
empty string will show junk..
Diffstat (limited to 'lib/libbluetooth')
-rw-r--r--lib/libbluetooth/sdp_data.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libbluetooth/sdp_data.c b/lib/libbluetooth/sdp_data.c
index ae05ca0bad3..0b6fba3424a 100644
--- a/lib/libbluetooth/sdp_data.c
+++ b/lib/libbluetooth/sdp_data.c
@@ -1,4 +1,4 @@
-/* $NetBSD: sdp_data.c,v 1.1 2009/05/12 10:05:06 plunky Exp $ */
+/* $NetBSD: sdp_data.c,v 1.2 2011/07/07 10:44:50 plunky Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: sdp_data.c,v 1.1 2009/05/12 10:05:06 plunky Exp $");
+__RCSID("$NetBSD: sdp_data.c,v 1.2 2011/07/07 10:44:50 plunky Exp $");
#include <sdp.h>
#include <stdarg.h>
@@ -358,6 +358,7 @@ _sdp_putstr(int indent, int style, const char *type,
printf("%*s", indent, "");
style |= VIS_NL;
+ buf[0] = '\0';
while (len > 0 && (dst + 5) < (buf + sizeof(buf))) {
dst = vis(dst, str[0], style, (len > 0 ? str[1] : 0));