Improve sanity checking of reception claim count. Fixes bug 5521.

svn path=/trunk/; revision=35287
This commit is contained in:
Chris Maynard 2010-12-28 18:02:24 +00:00
parent 735709bee6
commit f18068e9ef
1 changed files with 4 additions and 4 deletions

View File

@ -431,14 +431,14 @@ dissect_report_segment(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ltp_tree,
}
rcpt_clm_cnt = evaluate_sdnv(tvb,frame_offset + segment_offset, &rcpt_clm_cnt_size);
if (rcpt_clm_cnt < 0){
expert_add_info_format(pinfo, ltp_tree, PI_UNDECODED, PI_ERROR, "Negative reception claim count: %d", rcpt_clm_cnt);
return 0;
}
segment_offset += rcpt_clm_cnt_size;
if((unsigned)(frame_offset + segment_offset) > tvb_length(tvb)){
return 0;
}
if ((rcpt_clm_cnt < 0) || (rcpt_clm_cnt > (tvb_reported_length_remaining(tvb, frame_offset + segment_offset) / 2))){
expert_add_info_format(pinfo, ltp_tree, PI_UNDECODED, PI_ERROR, "Non-sensical reception claim count: %d", rcpt_clm_cnt);
return 0;
}
offset = ep_alloc(sizeof(guint64) * rcpt_clm_cnt);
offset_size = ep_alloc(sizeof(int) * rcpt_clm_cnt);