Fix Argument with 'nonnull' attribute passed null found by Clang
authorAlexis La Goutte <alexis.lagoutte@gmail.com>
Mon, 14 Apr 2014 06:59:28 +0000 (08:59 +0200)
committerAnders Broman <a.broman58@gmail.com>
Mon, 14 Apr 2014 11:52:35 +0000 (11:52 +0000)
Change-Id: If1c907308a7c776a6198530663f8dce03839d43b
Reviewed-on: https://code.wireshark.org/review/1098
Reviewed-by: Anders Broman <a.broman58@gmail.com>
text2pcap.c

index 77310326cea996243dd32939e43712ad8aaf4795..4b1a349a89a64e16e083751a59867dd7edba5870 100644 (file)
@@ -463,6 +463,11 @@ parse_num (const char *str, int offset)
     guint32  num;
     char    *c;
 
+    if (str == NULL) {
+        fprintf(stderr, "FATAL ERROR: str is NULL\n");
+        exit(1);
+    }
+
     num = (guint32)strtoul(str, &c, offset ? offset_base : 16);
     if (c == str) {
         fprintf(stderr, "FATAL ERROR: Bad hex number? [%s]\n", str);