From 5bbcd2919f3c9469fca80698eecf112ef3185f71 Mon Sep 17 00:00:00 2001 From: plunky Date: Sat, 16 Apr 2011 07:19:36 +0000 Subject: [PATCH] when placing an attribute/value pair, validate that the value given is a single data element --- lib/libbluetooth/sdp_put.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libbluetooth/sdp_put.c b/lib/libbluetooth/sdp_put.c index 6cb96ed50b9a..d60739c711ac 100644 --- a/lib/libbluetooth/sdp_put.c +++ b/lib/libbluetooth/sdp_put.c @@ -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 -__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 #include @@ -65,6 +65,7 @@ sdp_put_attr(sdp_data_t *data, uint16_t attr, sdp_data_t *value) 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;