opcua dissector: Fix parsing of 7 byte numeric service NodeIds.
authorGerhard Gappmeier <gerhard.gappmeier@ascolab.com>
Thu, 25 Jun 2015 12:53:14 +0000 (14:53 +0200)
committerAnders Broman <a.broman58@gmail.com>
Wed, 1 Jul 2015 11:13:10 +0000 (11:13 +0000)
The service NodeIds of OPC UA are normally encoded as 4 byte numeric NodeId.
However, it is technically also possible to encode these as (less efficient) 7 byte numeric NodeId.
This kind of NodeId was already implemented, but wrong.
Since then no one ever used this kind of NodeId for service NodeIds.

Change-Id: I8654d969604e18bce8415931e455632e72d578ef
Reviewed-on: https://code.wireshark.org/review/9435
Reviewed-by: Anders Broman <a.broman58@gmail.com>
plugins/opcua/opcua_application_layer.c

index 82e8647aac3ae09adcaf8ed5009376892533e81e..7d15c75c4a425779ffa7346340613c46f953d93f 100644 (file)
@@ -85,8 +85,8 @@ int parseServiceNodeId(proto_tree *tree, tvbuff_t *tvb, gint *pOffset)
         iOffset+=2;
         break;
     case 0x02: /* numeric, that does not fit into four bytes */
-        proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 4, ENC_LITTLE_ENDIAN);
-        iOffset+=4;
+        proto_tree_add_item(tree, hf_opcua_app_nsid, tvb, iOffset, 2, ENC_LITTLE_ENDIAN);
+        iOffset+=2;
         Numeric = tvb_get_letohl(tvb, iOffset);
         proto_tree_add_item(tree, hf_opcua_app_numeric, tvb, iOffset, 4, ENC_LITTLE_ENDIAN);
         iOffset+=4;