diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-26 09:21:23 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-02-26 09:21:23 +0200 |
commit | 02cd65fff0eac590c55968509c9023b691c69245 (patch) | |
tree | 5884687cf65ee7673d05a08a980e2dd02c04d854 /src | |
parent | 9d2a1187bbe371b16009fe241e30c0ed16a0c51a (diff) |
Require all parsed elements in extract_des to be of the same type
The extract_des function returns just one element type to the caller so
if there are mixed elements it'll be impossible for the caller to know
how to handle the returned list.
Diffstat (limited to 'src')
-rw-r--r-- | src/sdpd-request.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sdpd-request.c b/src/sdpd-request.c index 5bdb4016..44d30181 100644 --- a/src/sdpd-request.c +++ b/src/sdpd-request.c @@ -101,7 +101,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p short numberOfElements = 0; int seqlen = 0; sdp_list_t *pSeq = NULL; - uint8_t dataType; + uint8_t dataType = expectedType; int status = 0; const uint8_t *p; int bufsize; @@ -127,7 +127,11 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p return -1; } - dataType = *(uint8_t *)p; + if (dataType == SDP_TYPE_ANY) + expectedType = *p; + + dataType = *p; + SDPDBG("Data type: 0x%02x", dataType); if (expectedType == SDP_TYPE_UUID) { |