summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2009-10-20 14:03:00 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2009-10-20 14:03:00 +0000
commit762af05327beae618465a750f5e353f89345a4a8 (patch)
treee0345a8b231c231f1e0899df039bd236c3c6f411 /plugins
parentd43aab714cb4de4f908d4fb48c9c459436d1b528 (diff)
downloadwireshark-762af05327beae618465a750f5e353f89345a4a8.tar.gz
Don't call PROTO_ITEM_SET_GENERATED(proto_tree_add[...]): that will end up adding the item to the tree multiple times.
svn path=/trunk/; revision=30635
Diffstat (limited to 'plugins')
-rw-r--r--plugins/opcua/opcua_simpletypes.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/plugins/opcua/opcua_simpletypes.c b/plugins/opcua/opcua_simpletypes.c
index 45a7a10640..3b4537f47f 100644
--- a/plugins/opcua/opcua_simpletypes.c
+++ b/plugins/opcua/opcua_simpletypes.c
@@ -3,15 +3,15 @@
**
** Copyright (C) 2006-2007 ascolab GmbH. All Rights Reserved.
** Web: http://www.ascolab.com
-**
+**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License
** as published by the Free Software Foundation; either version 2
** of the License, or (at your option) any later version.
-**
+**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
+**
** Project: OpcUa Wireshark Plugin
**
** Description: Implementation of OpcUa built-in type parsers.
@@ -364,7 +364,7 @@ void parseString(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex)
void parseStatusCode(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfIndex)
{
- proto_tree_add_item(tree, hfIndex, tvb, *pOffset, 4, TRUE);
+ proto_tree_add_item(tree, hfIndex, tvb, *pOffset, 4, TRUE);
*pOffset += 4;
}
@@ -630,7 +630,7 @@ void parseVariant(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldN
case OpcUaType_Variant: parseVariant(subtree, tvb, &iOffset, "Value"); break;
}
}
-
+
if (EncodingMask & VARIANT_ARRAYDIMENSIONS)
{
proto_item *ti = proto_tree_add_text(tree, tvb, 0, -1, "Array Dimensions");
@@ -646,8 +646,10 @@ void parseVariant(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szFieldN
}
else
{
+ proto_item *pi;
/* XXX - This should be expert_add_info_format, but we need pinfo for that */
- PROTO_ITEM_SET_GENERATED(proto_tree_add_text(tree, tvb, iOffset, 4, "Array length %d too large to process", ArrayLength));
+ pi = proto_tree_add_text(tree, tvb, iOffset, 4, "Array length %d too large to process", ArrayLength);
+ PROTO_ITEM_SET_GENERATED(pi);
}
}
@@ -675,7 +677,9 @@ void parseArraySimple(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, int hfInde
if (iLen > MAX_ARRAY_LEN)
{
- PROTO_ITEM_SET_GENERATED(proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen));
+ proto_item *pi;
+ pi = proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen);
+ PROTO_ITEM_SET_GENERATED(pi);
return;
}
@@ -707,7 +711,9 @@ void parseArrayEnum(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, fctEnumParse
if (iLen > MAX_ARRAY_LEN)
{
- PROTO_ITEM_SET_GENERATED(proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen));
+ proto_item *pi;
+ pi = proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen);
+ PROTO_ITEM_SET_GENERATED(pi);
return;
}
@@ -738,7 +744,9 @@ void parseArrayComplex(proto_tree *tree, tvbuff_t *tvb, gint *pOffset, char *szF
if (iLen > MAX_ARRAY_LEN)
{
- PROTO_ITEM_SET_GENERATED(proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen));
+ proto_item *pi;
+ pi = proto_tree_add_text(tree, tvb, *pOffset, 4, "Array length %d too large to process", iLen);
+ PROTO_ITEM_SET_GENERATED(pi);
return;
}