aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smb-pipe.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2005-05-10 03:10:09 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2005-05-10 03:10:09 +0000
commitda3338ee8f48ad79a3f1952b8facab1434f5123a (patch)
tree897663d31077e3bf97474fc4916d2fae747e8d30 /epan/dissectors/packet-smb-pipe.c
parent911d63cd5eaf16b9e0f96089d593bff0f4e1ffe5 (diff)
Make a field type check more strict. Remove some unnecessary code.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14338 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-smb-pipe.c')
-rw-r--r--epan/dissectors/packet-smb-pipe.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/epan/dissectors/packet-smb-pipe.c b/epan/dissectors/packet-smb-pipe.c
index f660aafc1d..4032785262 100644
--- a/epan/dissectors/packet-smb-pipe.c
+++ b/epan/dissectors/packet-smb-pipe.c
@@ -283,8 +283,9 @@ add_byte_param(tvbuff_t *tvb, int offset, int count, packet_info *pinfo _U_,
if (hf_index != -1) {
hfinfo = proto_registrar_get_nth(hf_index);
- if (hfinfo && count != 1 &&
- (hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8)) {
+ if (hfinfo && count != 1 &&
+ (hfinfo->type == FT_INT8 || hfinfo->type == FT_UINT8)
+ && count != 1) {
THROW(ReportedBoundsError);
}
proto_tree_add_item(tree, hf_index, tvb, offset, count, TRUE);
@@ -1720,10 +1721,6 @@ dissect_request_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, 0, *items->hf_index);
items++;
@@ -1880,10 +1877,6 @@ dissect_response_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, 0, *items->hf_index);
items++;
@@ -2086,10 +2079,6 @@ dissect_transact_data(tvbuff_t *tvb, int offset, int convert,
offset += count;
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, convert, *items->hf_index);
items++;
@@ -2183,10 +2172,6 @@ dissect_transact_data(tvbuff_t *tvb, int offset, int convert,
tvb_bytes_to_str(tvb, cptr, count));
items++;
} else {
- if (items->type == PARAM_WORD && count != 2 ||
- items->type == PARAM_DWORD && count != 4) {
- THROW(ReportedBoundsError);
- }
offset = (*items->func)(tvb, offset, count,
pinfo, tree, convert, *items->hf_index);
items++;