From 7762ee33dab4e8ae6d87d47be245b44296fd3514 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Thu, 3 Dec 2015 19:31:55 +0100 Subject: [PATCH] text_import: Argument with 'nonnull' attribute passed null found by Clang Analyzer Change-Id: Ie070aa0f58cca156661ddd5689596e29ad56b128 Reviewed-on: https://code.wireshark.org/review/12412 Reviewed-by: Alexis La Goutte Petri-Dish: Alexis La Goutte Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/text_import.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/text_import.c b/ui/text_import.c index d7f4b2dcac..f320eb5e42 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -566,6 +566,10 @@ append_to_preamble(char *str) /* Add a blank separator between the previous token and this token. */ packet_preamble[packet_preamble_len++] = ' '; } + if(str == NULL){ + fprintf(stderr, "FATAL ERROR: str is NULL\n"); + exit(1); + } toklen = strlen(str); if (toklen != 0) { if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN)