Module Name: src
Committed By: plunky
Date: Sat Apr 16 07:19:37 UTC 2011
Modified Files:
src/lib/libbluetooth: sdp_put.c
Log Message:
when placing an attribute/value pair, validate that the value given
is a single data element
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libbluetooth/sdp_put.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_put.c
diff -u src/lib/libbluetooth/sdp_put.c:1.5 src/lib/libbluetooth/sdp_put.c:1.6
--- src/lib/libbluetooth/sdp_put.c:1.5 Tue Apr 5 18:19:04 2011
+++ src/lib/libbluetooth/sdp_put.c Sat Apr 16 07:19:36 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: sdp_put.c,v 1.5 2011/04/05 18:19:04 plunky Exp $ */
+/* $NetBSD: sdp_put.c,v 1.6 2011/04/16 07:19:36 plunky Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: sdp_put.c,v 1.5 2011/04/05 18:19:04 plunky Exp $");
+__RCSID("$NetBSD: sdp_put.c,v 1.6 2011/04/16 07:19:36 plunky Exp $");
#include <bluetooth.h>
#include <limits.h>
@@ -65,6 +65,7 @@
sdp_data_t d = *data;
if (!sdp_put_uint16(&d, attr)
+ || sdp_data_size(value) != (value->end - value->next)
|| !sdp_put_data(&d, value))
return false;