Module Name:    src
Committed By:   plunky
Date:           Thu Jul  7 10:44:51 UTC 2011

Modified Files:
        src/lib/libbluetooth: sdp_data.c

Log Message:
ensure that the buffer is nul-terminated, otherwise printing an
empty string will show junk..


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/libbluetooth/sdp_data.c

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

Modified files:

Index: src/lib/libbluetooth/sdp_data.c
diff -u src/lib/libbluetooth/sdp_data.c:1.1 src/lib/libbluetooth/sdp_data.c:1.2
--- src/lib/libbluetooth/sdp_data.c:1.1	Tue May 12 10:05:06 2009
+++ src/lib/libbluetooth/sdp_data.c	Thu Jul  7 10:44:50 2011
@@ -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 @@
 	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));

Reply via email to