summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--text2pcap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/text2pcap.c b/text2pcap.c
index 77310326ce..4b1a349a89 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -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);