Rather than repairing out-of-range subframe numbers, make sure error gets reported (and then are not used to access beyond subframe arrays).

svn path=/trunk/; revision=35531
This commit is contained in:
Martin Mathieson 2011-01-14 11:21:28 +00:00
parent cc3952ca4f
commit b1dd79a122

View file

@ -1603,6 +1603,11 @@ static int DetectIfDLHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatile int
DLHARQResult *result = NULL;
proto_item *result_ti;
/* If out-of-range just give up */
if (p_mac_lte_info->subframeNumber > 9) {
return FALSE;
}
/* TDD may not work... */
if (!pinfo->fd->flags.visited) {
@ -1740,6 +1745,11 @@ static void TrackReportedULHARQResend(packet_info *pinfo, tvbuff_t *tvb, volatil
return;
}
/* If out-of-range just give up */
if (p_mac_lte_info->subframeNumber > 9) {
return;
}
if (!pinfo->fd->flags.visited) {
/* First time, so set result and update UL harq table */
LastFrameData *lastData = NULL;
@ -3029,9 +3039,11 @@ void dissect_mac_lte(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
tvb, 0, 0, p_mac_lte_info->subframeNumber);
PROTO_ITEM_SET_GENERATED(ti);
if (p_mac_lte_info->subframeNumber > 9) {
/* N.B. if we set it to avlid value, it won't trigger when we rescan
(at least with DCT2000 files where the context struct isn't re-read). */
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
"Subframe number was out of range - using max (9) instead");
p_mac_lte_info->subframeNumber = 9;
"Subframe number (%u) was out of range - valid range is 0-9",
p_mac_lte_info->subframeNumber);
}
if (p_mac_lte_info->subframeNumberOfGrantPresent) {