aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2015-08-26 22:52:06 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2015-08-26 20:57:09 +0000
commit8ad56117502207d95d54bd2c8dff24d001530d24 (patch)
treea5f81a1b78b234181ba4f5bc0b5e7fc97c6e7332 /asn1
parent7b35992b7a15ad2306d23c9f2a66199a7f8ea975 (diff)
sv: remove some unnecessary checks
http://personal.strath.ac.uk/robert.c.atkinson/papers/sgms2011.pdf implies that appid, length and the two reserved fields are mandatory just try to dissect them, don't check if there's enough bytes remaining correct a typo while at it Change-Id: I09a315fc2c70161af527dca5661f877e09b63ff6 Reviewed-on: https://code.wireshark.org/review/10273 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'asn1')
-rw-r--r--asn1/sv/packet-sv-template.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/asn1/sv/packet-sv-template.c b/asn1/sv/packet-sv-template.c
index 3a13b50aef..5403d02df9 100644
--- a/asn1/sv/packet-sv-template.c
+++ b/asn1/sv/packet-sv-template.c
@@ -1,5 +1,5 @@
/* packet-sv.c
- * Routines for IEC 61850 Sampled Vales packet dissection
+ * Routines for IEC 61850 Sampled Values packet dissection
* Michael Bernhard 2008
*
* Wireshark - Network traffic analyzer
@@ -113,23 +113,19 @@ dissect_sv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
col_clear(pinfo->cinfo, COL_INFO);
/* APPID */
- if (tree && tvb_reported_length_remaining(tvb, offset) >= 2)
- proto_tree_add_item(tree, hf_sv_appid, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_sv_appid, tvb, offset, 2, ENC_BIG_ENDIAN);
/* Length */
- if (tree && tvb_reported_length_remaining(tvb, offset) >= 4)
- proto_tree_add_item(tree, hf_sv_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_sv_length, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
/* Reserved 1 */
- if (tree && tvb_reported_length_remaining(tvb, offset) >= 6)
- proto_tree_add_item(tree, hf_sv_reserve1, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_sv_reserve1, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
/* Reserved 2 */
- if (tree && tvb_reported_length_remaining(tvb, offset) >= 8)
- proto_tree_add_item(tree, hf_sv_reserve2, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(tree, hf_sv_reserve2, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
offset = 8;
- while (tree && tvb_reported_length_remaining(tvb, offset) > 0){
+ while (tvb_reported_length_remaining(tvb, offset) > 0){
old_offset = offset;
offset = dissect_sv_SampledValues(FALSE, tvb, offset, &asn1_ctx , tree, -1);
if (offset == old_offset) {