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 <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2015-12-03 19:31:55 +01:00 committed by Michael Mann
parent cda4b0f4b7
commit 7762ee33da
1 changed files with 4 additions and 0 deletions

View File

@ -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)