forked from osmocom/wireshark
dcerpc-browser: don't THROW() an exception from a dissector
the condition for THROW() will never be true there's no way to decrement offset below its initial value the dissect_browser_TYPE_x_data() functions read a uint32 and increment offset by 4 + the uint32 value that was read Change-Id: Ia5a63e714ffa0add601960d858452152e4d9b10b Reviewed-on: https://code.wireshark.org/review/15627 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx> Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
c755c88785
commit
e00d73aaef
|
@ -90,7 +90,6 @@ dissect_browser_TYPE_4_data(tvbuff_t *tvb, int offset,
|
|||
dcerpc_info *di, guint8 *drep)
|
||||
{
|
||||
guint32 len;
|
||||
int old_offset = offset;
|
||||
|
||||
if(di->conformant_run){
|
||||
/* this call is to make wireshark eat the array header for the conformant run */
|
||||
|
@ -104,8 +103,6 @@ dissect_browser_TYPE_4_data(tvbuff_t *tvb, int offset,
|
|||
proto_tree_add_item(tree, hf_browser_unknown_bytes, tvb, offset, len,
|
||||
ENC_NA);
|
||||
offset += len;
|
||||
if (offset < old_offset)
|
||||
THROW(ReportedBoundsError);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
@ -137,7 +134,6 @@ dissect_browser_TYPE_3_data(tvbuff_t *tvb, int offset,
|
|||
dcerpc_info *di, guint8 *drep)
|
||||
{
|
||||
guint32 len;
|
||||
int old_offset = offset;
|
||||
|
||||
if(di->conformant_run){
|
||||
/* this call is to make wireshark eat the array header for the conformant run */
|
||||
|
@ -152,8 +148,6 @@ dissect_browser_TYPE_3_data(tvbuff_t *tvb, int offset,
|
|||
proto_tree_add_item(tree, hf_browser_unknown_bytes, tvb, offset, len,
|
||||
ENC_NA);
|
||||
offset += len;
|
||||
if (offset < old_offset)
|
||||
THROW(ReportedBoundsError);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
@ -741,7 +735,6 @@ dissect_browser_TYPE_9_data(tvbuff_t *tvb, int offset,
|
|||
dcerpc_info *di, guint8 *drep)
|
||||
{
|
||||
guint32 len;
|
||||
int old_offset = offset;
|
||||
|
||||
if(di->conformant_run){
|
||||
/* this call is to make wireshark eat the array header for the conformant run */
|
||||
|
@ -757,8 +750,6 @@ dissect_browser_TYPE_9_data(tvbuff_t *tvb, int offset,
|
|||
proto_tree_add_item(tree, hf_browser_unknown_bytes, tvb, offset, len,
|
||||
ENC_NA);
|
||||
offset += len;
|
||||
if (offset < old_offset)
|
||||
THROW(ReportedBoundsError);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
@ -931,7 +922,6 @@ dissect_browser_TYPE_12_data(tvbuff_t *tvb, int offset,
|
|||
dcerpc_info *di, guint8 *drep)
|
||||
{
|
||||
guint32 len;
|
||||
int old_offset = offset;
|
||||
|
||||
if(di->conformant_run){
|
||||
/* this call is to make wireshark eat the array header for the conformant run */
|
||||
|
@ -947,8 +937,6 @@ dissect_browser_TYPE_12_data(tvbuff_t *tvb, int offset,
|
|||
proto_tree_add_item(tree, hf_browser_unknown_bytes, tvb, offset, len,
|
||||
ENC_NA);
|
||||
offset += len;
|
||||
if (offset < old_offset)
|
||||
THROW(ReportedBoundsError);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue