From 6a071bd0026898a3f43074280b1004e8f0aea2e4 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 16 Jan 2009 11:18:04 +0200 Subject: Bail out from extract_des if sdp_uuid_extract fails --- src/sdpd-request.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/sdpd-request.c b/src/sdpd-request.c index 15cba2b2..acfacaf4 100644 --- a/src/sdpd-request.c +++ b/src/sdpd-request.c @@ -176,11 +176,11 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p case SDP_UUID128: pElem = malloc(sizeof(uuid_t)); status = sdp_uuid_extract(p, bufsize, (uuid_t *) pElem, &localSeqLength); - if (status == 0) { - seqlen += localSeqLength; - p += localSeqLength; - bufsize -= localSeqLength; - } + if (status < 0) + return -1; + seqlen += localSeqLength; + p += localSeqLength; + bufsize -= localSeqLength; break; default: return -1; -- cgit