Fix Argument with 'nonnull' attribute passed null found by Clang

Change-Id: I9b8a6c37e4ed589ac3066ec9cbb1b63a9f30a12b
Reviewed-on: https://code.wireshark.org/review/1097
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2014-04-14 08:59:07 +02:00 committed by Anders Broman
parent 2ce2320de0
commit 45143c6eac
1 changed files with 6 additions and 4 deletions

View File

@ -704,11 +704,13 @@ packet_list_change_record(PacketList *packet_list, PacketListRecord *record, gin
/* !! FALL-THROUGH!! */
default:
col_text_len = strlen(cinfo->col_data[col]);
if (col_text_len > G_MAXUSHORT)
col_text_len = G_MAXUSHORT;
if(cinfo->col_data[col]){
col_text_len = strlen(cinfo->col_data[col]);
if (col_text_len > G_MAXUSHORT)
col_text_len = G_MAXUSHORT;
record->col_text_len[text_col] = (gushort) col_text_len;
record->col_text_len[text_col] = (gushort) col_text_len;
}
if (!record->col_text_len[text_col]) {
record->col_text[text_col] = "";
#ifdef PACKET_LIST_STATISTICS