If a payload type doesn't have a dissector function, don't crash by calling
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 4 Oct 2003 16:44:34 +0000 (16:44 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 4 Oct 2003 16:44:34 +0000 (16:44 +0000)
through the null dissector pointer, just dissect it as "Payload".

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8610 f5534014-38df-0310-8fa8-9805f1628bb7

packet-isakmp.c

index eb79d348e86694cde6d85a6e9be93df3a706fe19..c6089f99459ee1d24aa70b93dc5a681d8b6cdba3 100644 (file)
@@ -4,7 +4,7 @@
  * for ISAKMP (RFC 2407)
  * Brad Robel-Forrest <brad.robel-forrest@watchguard.com>
  *
- * $Id: packet-isakmp.c,v 1.68 2003/09/15 19:08:27 guy Exp $
+ * $Id: packet-isakmp.c,v 1.69 2003/10/04 16:44:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -330,7 +330,7 @@ dissect_payloads(tvbuff_t *tvb, proto_tree *tree, guint8 initial_payload,
     if (ntree == NULL)
       break;
     if (payload_length >= 4) { /* XXX = > 4? */
-      if (payload < NUM_LOAD_TYPES) {
+      if (payload < NUM_LOAD_TYPES && strfuncs[payload].func != NULL) {
         (*strfuncs[payload].func)(tvb, offset + 4, payload_length - 4, ntree,
                                  -1);
       }