wsmp: read the message length as big endian
authorMartin Kaiser <wireshark@kaiser.cx>
Wed, 7 Jun 2017 21:26:33 +0000 (23:26 +0200)
committerMichael Mann <mmann78@netscape.net>
Thu, 8 Jun 2017 02:23:57 +0000 (02:23 +0000)
We add the message length to the tree as big endian but we interpret it
as little endian for our further calculations. This causes parsing
errors. Use big endian for both cases.

Bug: 13766
Change-Id: I4e6cdb7d4267be96ea78eb664e88c532a9a90b52
Reviewed-on: https://code.wireshark.org/review/22024
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-wsmp.c

index 189d2098192099f04cdf57e01f8c231489b9274d..6480fb8ca833c9dfc691eec227d236ea44216ddf 100644 (file)
@@ -161,7 +161,7 @@ dissect_wsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
                         hf_wsmp_WAVEid, tvb, offset, 1, ENC_BIG_ENDIAN);
     offset++;
 
-    wsmlength = tvb_get_letohs( tvb, offset);
+    wsmlength = tvb_get_ntohs( tvb, offset);
     proto_tree_add_item(wsmp_tree,
                         hf_wsmp_wsmlength, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset += 2;