Commit 2276e767 authored by Max Kellermann's avatar Max Kellermann

mapper: fix potential crash in file permission check

parent 93f9c2ab
...@@ -10,6 +10,7 @@ ver 0.17.2 (2012/??/??) ...@@ -10,6 +10,7 @@ ver 0.17.2 (2012/??/??)
- httpd: use monotonic clock, avoid hiccups after system clock adjustment - httpd: use monotonic clock, avoid hiccups after system clock adjustment
- httpd: fix throttling bug after resuming playback - httpd: fix throttling bug after resuming playback
* mapper: fix non-UTF8 music directory name * mapper: fix non-UTF8 music directory name
* mapper: fix potential crash in file permission check
ver 0.17.1 (2012/07/31) ver 0.17.1 (2012/07/31)
......
...@@ -93,10 +93,10 @@ check_directory(const char *path) ...@@ -93,10 +93,10 @@ check_directory(const char *path)
#endif #endif
DIR *dir = opendir(path); DIR *dir = opendir(path);
if (dir == NULL && errno == EACCES) if (dir != NULL)
g_warning("No permission to read directory: %s", path);
else
closedir(dir); closedir(dir);
else if (errno == EACCES)
g_warning("No permission to read directory: %s", path);
} }
static void static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment