summaryrefslogtreecommitdiffstats
path: root/sdpd
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-03 03:39:33 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-03 03:39:33 +0000
commitce9b410db80d60fbc6d12c02255319d8ff0c3a53 (patch)
treefd588fdca657f9e9990551a37ef6de54080d746a /sdpd
parent5de33324633a5239a57a2d1ce6ab322950bb4b77 (diff)
Fix an endless if an attribute range has been requested
Diffstat (limited to 'sdpd')
-rw-r--r--sdpd/request.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sdpd/request.c b/sdpd/request.c
index 9e3f966f..1fdbdbe5 100644
--- a/sdpd/request.c
+++ b/sdpd/request.c
@@ -448,6 +448,7 @@ static int extract_attrs(sdp_record_t *rec, sdp_list_t *seq, uint8_t dtd, sdp_bu
uint16_t attr;
uint16_t low = (0xffff0000 & range) >> 16;
uint16_t high = 0x0000ffff & range;
+ sdp_data_t *data;
SDPDBG("attr range : 0x%x\n", range);
SDPDBG("Low id : 0x%x\n", low);
@@ -460,11 +461,14 @@ static int extract_attrs(sdp_record_t *rec, sdp_list_t *seq, uint8_t dtd, sdp_bu
break;
}
/* (else) sub-range of attributes */
- for (attr = low; attr <= high; attr++) {
- sdp_data_t *a = (sdp_data_t *)sdp_data_get(rec, attr);
- if (a)
- sdp_append_to_pdu(buf, a);
+ for (attr = low; attr < high; attr++) {
+ data = sdp_data_get(rec, attr);
+ if (data)
+ sdp_append_to_pdu(buf, data);
}
+ data = sdp_data_get(rec, high);
+ if (data)
+ sdp_append_to_pdu(buf, data);
}
free(pdu.data);
} else {