diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-09-09 13:30:45 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-09-09 13:31:00 -0700 |
commit | 1be808f4166f836fc0767b38b15bb1eef8c6b305 (patch) | |
tree | 7ed38ae30c74d8cb89f5cdd7703fda5fb05204f1 | |
parent | 402792027413a3b90fe5a82d3a82a2ad1628e56d (diff) | |
download | libpcap-1be808f4166f836fc0767b38b15bb1eef8c6b305.tar.gz |
Check for a null pointer supplied as the file name.
We already check for it when doing a live capture open; we might as well
check for it when opening a file.
-rw-r--r-- | savefile.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -276,6 +276,11 @@ pcap_open_offline_with_tstamp_precision(const char *fname, u_int precision, FILE *fp; pcap_t *p; + if (fname == NULL) { + pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, + "A null pointer was supplied as the file name"); + return (NULL); + } if (fname[0] == '-' && fname[1] == '\0') { fp = stdin; |