aboutsummaryrefslogtreecommitdiffstats
path: root/packet-smb-common.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-02-14 04:22:22 +0000
committerGuy Harris <guy@alum.mit.edu>2000-02-14 04:22:22 +0000
commitd530dd86431efeb054cfc28045ae45cc5ec3a4c2 (patch)
tree8b14f190d72068ee070b6538daa5f8218fcc7cc0 /packet-smb-common.c
parent4b72e6b99a076d08301f1eb95c5a2c2ed0deca34 (diff)
In "display_flags()", panic if the size handed to it is neither 1, 2,
nor 4, as we currently don't handle that. svn path=/trunk/; revision=1634
Diffstat (limited to 'packet-smb-common.c')
-rw-r--r--packet-smb-common.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/packet-smb-common.c b/packet-smb-common.c
index 9f22246821..067f401ead 100644
--- a/packet-smb-common.c
+++ b/packet-smb-common.c
@@ -2,7 +2,7 @@
* Common routines for smb packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-common.c,v 1.2 2000/02/14 04:05:53 guy Exp $
+ * $Id: packet-smb-common.c,v 1.3 2000/02/14 04:22:22 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -122,10 +122,24 @@ display_flags( struct flag_array_type *flag_array, int length,
guint32 flags;
- if ( length == 1) flags = GBYTE( pd, offset);
- if ( length == 2) flags = GSHORT( pd, offset);
- if ( length == 4) flags = GWORD( pd, offset);
-
+ switch (length) {
+
+ case 1:
+ flags = GBYTE( pd, offset);
+ break;
+
+ case 2:
+ flags = GSHORT( pd, offset);
+ break;
+
+ case 4:
+ flags = GWORD( pd, offset);
+ break;
+
+ default:
+ g_assert_not_reached();
+ return;
+ }
while( array_ptr->mask) {
proto_tree_add_text( tree, offset, 2, "%s%s%s%s",