aboutsummaryrefslogtreecommitdiffstats
path: root/mergecap.c
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2014-02-25 11:10:50 -0500
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-02-25 21:11:25 +0000
commit795565491157c253081560209de765b1a98c1c56 (patch)
tree76860160d4178f591e85317401088980f4b0b02f /mergecap.c
parentbd36fe1bcbe19dd1b63836cc60d7351d7d8b4aa8 (diff)
Fix mergecap.c: Dereference of null pointer (clang analyzer)
Change-Id: I89076388db8522c5fbdf72505f50e1380f1ab391 Reviewed-on: https://code.wireshark.org/review/369 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'mergecap.c')
-rw-r--r--mergecap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mergecap.c b/mergecap.c
index afc3bad29a..37fa8839dd 100644
--- a/mergecap.c
+++ b/mergecap.c
@@ -512,7 +512,7 @@ main(int argc, char *argv[])
* report the frame number and file type/subtype.
*/
fprintf(stderr, "mergecap: Frame %u of \"%s\" has a network type that can't be saved in a \"%s\" file.\n",
- in_file->packet_num, in_file->filename,
+ in_file ? in_file->packet_num : 0, in_file ? in_file->filename : "UNKNOWN",
wtap_file_type_subtype_string(file_type));
break;
@@ -523,7 +523,7 @@ main(int argc, char *argv[])
* report the frame number and file type/subtype.
*/
fprintf(stderr, "mergecap: Frame %u of \"%s\" is too large for a \"%s\" file\n.",
- in_file->packet_num, in_file->filename,
+ in_file ? in_file->packet_num : 0, in_file ? in_file->filename : "UNKNOWN",
wtap_file_type_subtype_string(file_type));
break;