diff options
author | Hadriel Kaplan <hadrielk@yahoo.com> | 2014-02-25 11:05:17 -0500 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-02-25 20:52:48 +0000 |
commit | 907a8259862401af3fdc8ad1201e13c6abf677db (patch) | |
tree | 7b019c10c25c79bb7a9f3d7727584923a25bb327 /file.c | |
parent | 5478483eef9e24e6276b1703b88258bfc44a861f (diff) |
Fix file.c: Dereference of null pointer (clang analyzer)
Change-Id: Ib96e5ffb284234562c2883c13e93109173e22179
Reviewed-on: https://code.wireshark.org/review/368
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1629,10 +1629,10 @@ cf_merge_files(char **out_filenamep, int in_file_count, * the file type and subtype we're writing; note that, and report * the frame number and file type/subtype. */ - display_basename = g_filename_display_basename(in_file->filename); + display_basename = g_filename_display_basename(in_file ? in_file->filename : "UNKNOWN"); simple_error_message_box( "Frame %u of \"%s\" has a network type that can't be saved in a \"%s\" file.", - in_file->packet_num, display_basename, + in_file ? in_file->packet_num : 0, display_basename, wtap_file_type_subtype_string(file_type)); g_free(display_basename); break; @@ -1643,10 +1643,10 @@ cf_merge_files(char **out_filenamep, int in_file_count, * the file type and subtype we're writing; note that, and report * the frame number and file type/subtype. */ - display_basename = g_filename_display_basename(in_file->filename); + display_basename = g_filename_display_basename(in_file ? in_file->filename : "UNKNOWN"); simple_error_message_box( "Frame %u of \"%s\" is too large for a \"%s\" file.", - in_file->packet_num, display_basename, + in_file ? in_file->packet_num : 0, display_basename, wtap_file_type_subtype_string(file_type)); g_free(display_basename); break; |