Don't try to reassemble a zero-length fragment. Add a comment to

reassemble.c about the handling of zero-length fragments.

svn path=/trunk/; revision=15899
This commit is contained in:
Gerald Combs 2005-09-20 17:23:19 +00:00
parent 27a1e92489
commit ba83bf145f
2 changed files with 8 additions and 1 deletions

View File

@ -511,7 +511,7 @@ reassemble_octet_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int
static GHashTable *octet_segment_table = NULL;
static GHashTable *octet_reassembled_table = NULL;
fragment_data *fd_head = NULL;
tvbuff_t *next_tvb;
tvbuff_t *next_tvb = NULL;
tvbuff_t *reassembled_tvb = NULL;
guint16 dst_ref = 0;
int start_offset = offset;
@ -560,6 +560,11 @@ reassemble_octet_string(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int
break;
}
if (tvb_length(next_tvb) < 1) {
/* Don't cause an assertion in the reassembly code. */
THROW(ReportedBoundsError);
}
fd_head = fragment_add_seq_next(next_tvb, 0, pinfo, dst_ref,
octet_segment_table,
octet_reassembled_table,

View File

@ -1467,6 +1467,8 @@ fragment_add_dcerpc_dg(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 id
* of that (empty) list.
*
* Otherwise, it returns NULL.
*
* XXX - Should we simply return NULL for zero-length fragments?
*/
static fragment_data *
fragment_add_seq_check_work(tvbuff_t *tvb, int offset, packet_info *pinfo,