Check to see if we've passed a null strval to ndps_string().
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 12 Oct 2006 15:00:07 +0000 (15:00 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 12 Oct 2006 15:00:07 +0000 (15:00 +0000)
Should fix the recent fuzz bugs.

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

epan/dissectors/packet-ndps.c

index 165010e38ffa0846708c9a1176d9abfad43e5748..e6c76cd07731f9e90998b9f69af6d6e899e99fb5 100644 (file)
@@ -2023,7 +2023,8 @@ ndps_string(tvbuff_t* tvb, int hfinfo, proto_tree *ndps_tree, int offset, char *
     if(str_length == 0)
     {
         proto_tree_add_string(ndps_tree, hfinfo, tvb, offset, 4, "<Not Specified>");
-        *stringval = ep_strdup("");
+        if (stringval != NULL)
+          *stringval = ep_strdup("");
         return foffset;
     }
     if (str_length <= 2 || (str_length & 0x01) || tvb_get_guint8(tvb, foffset + 1) != 0) {