File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -4826,14 +4826,21 @@ pcap_findalldevs_ex(const char *source, struct pcap_rmtauth *auth _USED_FOR_REMO
4826
4826
#else
4827
4827
/* opening the folder */
4828
4828
unixdir = opendir (path );
4829
+ if (unixdir == NULL ) {
4830
+ DIAG_OFF_FORMAT_TRUNCATION
4831
+ snprintf (errbuf , PCAP_ERRBUF_SIZE ,
4832
+ "Error when listing files: does folder '%s' exist?" , path );
4833
+ DIAG_ON_FORMAT_TRUNCATION
4834
+ return (PCAP_ERROR );
4835
+ }
4829
4836
4830
4837
/* get the first file into it */
4831
4838
filedata = readdir (unixdir );
4832
4839
4833
4840
if (filedata == NULL ) {
4834
4841
DIAG_OFF_FORMAT_TRUNCATION
4835
4842
snprintf (errbuf , PCAP_ERRBUF_SIZE ,
4836
- "Error when listing files: does folder '%s' exist ?" , path );
4843
+ "Error when listing files: does folder '%s' contain files ?" , path );
4837
4844
DIAG_ON_FORMAT_TRUNCATION
4838
4845
closedir (unixdir );
4839
4846
return (PCAP_ERROR );
You can’t perform that action at this time.
0 commit comments