aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bacapp.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2012-08-02 14:21:57 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2012-08-02 14:21:57 +0000
commit3ab1e68751693593b42ff1eef8de648289016b0b (patch)
tree574baf523af43c6c6913b16167151199d16181df /epan/dissectors/packet-bacapp.c
parente71e8e041c437d880a1431f714c7bbc18bd92e0e (diff)
From Lori Tribble via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7556 :
The BACnet GetEnrollmentSummary-ACK has an optional parameter Notification Class. The Wireshark decoding does not correctly decode when this parameter is missing. The fix is to verify the context exists before attempting to decode this parameter. From me: replace the few remaining tabs in the file with spaces. svn path=/trunk/; revision=44207
Diffstat (limited to 'epan/dissectors/packet-bacapp.c')
-rw-r--r--epan/dissectors/packet-bacapp.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/epan/dissectors/packet-bacapp.c b/epan/dissectors/packet-bacapp.c
index be514da655..13f59e3067 100644
--- a/epan/dissectors/packet-bacapp.c
+++ b/epan/dissectors/packet-bacapp.c
@@ -49,15 +49,15 @@ static int bacapp_tap = -1;
#endif
/* BACnet PDU Types */
-#define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0
-#define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1
-#define BACAPP_TYPE_SIMPLE_ACK 2
-#define BACAPP_TYPE_COMPLEX_ACK 3
-#define BACAPP_TYPE_SEGMENT_ACK 4
-#define BACAPP_TYPE_ERROR 5
-#define BACAPP_TYPE_REJECT 6
-#define BACAPP_TYPE_ABORT 7
-#define MAX_BACAPP_TYPE 8
+#define BACAPP_TYPE_CONFIRMED_SERVICE_REQUEST 0
+#define BACAPP_TYPE_UNCONFIRMED_SERVICE_REQUEST 1
+#define BACAPP_TYPE_SIMPLE_ACK 2
+#define BACAPP_TYPE_COMPLEX_ACK 3
+#define BACAPP_TYPE_SEGMENT_ACK 4
+#define BACAPP_TYPE_ERROR 5
+#define BACAPP_TYPE_REJECT 6
+#define BACAPP_TYPE_ABORT 7
+#define MAX_BACAPP_TYPE 8
#define BACAPP_SEGMENTED_REQUEST 0x08
#define BACAPP_MORE_SEGMENTS 0x04
@@ -7161,7 +7161,7 @@ fBACnetPropertyStates(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, g
const gchar* label = NULL;
fTagHeader (tvb, pinfo, offset, &tag_no, &tag_info, &lvt);
- label = ep_strdup_printf( "%s: ", val_to_str_const( tag_no, VALS(BACnetPropertyStates), "Unknown State" ));
+ label = ep_strdup_printf( "%s: ", val_to_str_const( tag_no, VALS(BACnetPropertyStates), "Unknown State" ));
switch (tag_no) {
case 0:
@@ -8373,7 +8373,8 @@ fGetEnrollmentSummaryAck (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
offset = fApplicationTypesEnumerated (tvb, pinfo, tree, offset,
"event State: ", BACnetEventState);
offset = fApplicationTypes (tvb, pinfo, tree, offset, "Priority: ");
- offset = fApplicationTypes (tvb, pinfo, tree, offset, "Notification Class: ");
+ if (tvb_reported_length_remaining(tvb, offset) > 0 && fTagNo(tvb, offset) == 2) /* Notification Class - OPTIONAL */
+ offset = fUnsignedTag (tvb, pinfo, tree, offset, "Notification Class: ");
if (offset == lastoffset) break; /* nothing happened, exit loop */
}