diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-07-30 23:43:17 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-07-30 23:43:17 +0000 |
commit | d3a8e5614ceb0cd7167c83309fbfa856c0945465 (patch) | |
tree | 5212138364c50a4ebd8e8578ec03183030d7d3f1 /epan/dissectors/packet-rpcap.c | |
parent | fc1e1a9d4cd1a93df59d3275e69c43df699a253d (diff) |
tvb_length_remaining() can return -1 if the offset is out of bounds. Be sure to deal with it if it does. Fixes Coverity CID 280523: Improper use of negative value.
svn path=/trunk/; revision=44146
Diffstat (limited to 'epan/dissectors/packet-rpcap.c')
-rw-r--r-- | epan/dissectors/packet-rpcap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/dissectors/packet-rpcap.c b/epan/dissectors/packet-rpcap.c index dd0f15c1db..e3de008361 100644 --- a/epan/dissectors/packet-rpcap.c +++ b/epan/dissectors/packet-rpcap.c @@ -385,6 +385,8 @@ dissect_rpcap_error (tvbuff_t *tvb, packet_info *pinfo, gint len; len = tvb_length_remaining (tvb, offset); + if (len <= 0) + return; if (check_col (pinfo->cinfo, COL_INFO)) { col_append_fstr (pinfo->cinfo, COL_INFO, ": %s", |