aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bjnp.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2013-10-09 20:31:23 +0000
committerAnders Broman <anders.broman@ericsson.com>2013-10-09 20:31:23 +0000
commit51d6f57fd7d72ee70bd2ee9e70151a8c7e79bfc1 (patch)
tree1965fc0f9ef99c255d5fde19b87f4f9877013386 /epan/dissectors/packet-bjnp.c
parentf678c0fd4972ca28d669db80f8b6468bf32ac3d7 (diff)
Check if first char is printable.
svn path=/trunk/; revision=52478
Diffstat (limited to 'epan/dissectors/packet-bjnp.c')
-rw-r--r--epan/dissectors/packet-bjnp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-bjnp.c b/epan/dissectors/packet-bjnp.c
index 231df0b982..addde990a3 100644
--- a/epan/dissectors/packet-bjnp.c
+++ b/epan/dissectors/packet-bjnp.c
@@ -26,6 +26,8 @@
#include "config.h"
+#include <ctype.h>
+
#include <epan/packet.h>
#include <epan/wmem/wmem.h>
@@ -98,6 +100,10 @@ static int dissect_bjnp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, vo
guint8 dev_type, cmd_code;
gchar *info;
+ /* If it does not start with a printable character it's not BJNP */
+ if(!isprint(tvb_get_guint8(tvb, 0)))
+ return 0;
+
col_set_str (pinfo->cinfo, COL_PROTOCOL, PSNAME);
col_clear (pinfo->cinfo, COL_INFO);