From 7ba55660732192666f0d846906b4e8171a90fee8 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 9 Nov 2013 15:56:53 +0900 Subject: Don't access a NULL path This can happen if the Uemis is not correctly connected, but the user still has the path set (as default DC most likely) and tries to start a download. Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uemis-downloader.c') diff --git a/uemis-downloader.c b/uemis-downloader.c index b0cb5f1a7..e8e24b78e 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -143,7 +143,7 @@ static int number_of_file(char *path) struct dirent * entry; dirp = opendir(path); - while ((entry = readdir(dirp)) != NULL) { + while (dirp && (entry = readdir(dirp)) != NULL) { #ifndef WIN32 if (entry->d_type == DT_REG) /* If the entry is a regular file */ #endif -- cgit v1.2.3-70-g09d2