summaryrefslogtreecommitdiff
path: root/lib/sdp.c
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2013-01-08 19:05:25 -0400
committerMarcel Holtmann <marcel@holtmann.org>2013-01-08 18:24:53 -0800
commit504a0cf46ad89cab8005ce9cffb22e41048f6a30 (patch)
treee58eab2188c0fe2fa2d2aa6604aa589457beec35 /lib/sdp.c
parente01141697ab2ec6027eaec67360f411194d7e4e9 (diff)
downloadbluez-504a0cf46ad89cab8005ce9cffb22e41048f6a30.tar.gz
lib: Fix SDP_TEXT_STR16/SDP_URL_STR16 parsing
sdp_extract_attr() uses the "size" parameter to return the number of bytes consumed when parsing SDP Data Elements. This size is used to advance a buffer pointer to parse next element. This size was being incorrectly calculated for SDP_{TEXT,URL}_STR16 in extract_str(), where the string length was added twice. The string length is already added later in the function for {TEXT,URL}_STR{8,16} by this statement: *len += n;
Diffstat (limited to 'lib/sdp.c')
-rw-r--r--lib/sdp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sdp.c b/lib/sdp.c
index ca474cd3b..b87f392ac 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1176,7 +1176,7 @@ static sdp_data_t *extract_str(const void *p, int bufsize, int *len)
}
n = bt_get_be16(p);
p += sizeof(uint16_t);
- *len += sizeof(uint16_t) + n;
+ *len += sizeof(uint16_t);
bufsize -= sizeof(uint16_t);
break;
default: