input/access: fix out-of-bound read on hidden file
authorFilip Roséen <filip@videolabs.io>
Tue, 21 Jun 2016 13:03:32 +0000 (15:03 +0200)
committerThomas Guillem <thomas@gllm.fr>
Tue, 21 Jun 2016 13:35:03 +0000 (15:35 +0200)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
src/input/access.c

index 79417ac..e7df2ee 100644 (file)
@@ -547,7 +547,7 @@ static char *fsdir_name_from_filename(const char *psz_filename)
 
     /* remove extension */
     char *psz_ptr = strrchr(psz_name, '.');
 
     /* remove extension */
     char *psz_ptr = strrchr(psz_name, '.');
-    if (psz_ptr)
+    if (psz_ptr && psz_ptr != psz_name)
         *psz_ptr = '\0';
 
     /* remove trailing white spaces */
         *psz_ptr = '\0';
 
     /* remove trailing white spaces */