aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-03-13 23:14:27 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2013-03-13 23:22:23 +0000
commit91f2dc252db41593a646402fd33652bf565daa9e (patch)
tree24e3db78515b466db29c603eee43515c3433b0a4
parenteda49d7d45e75e593946874563923810ad035fb3 (diff)
downloadbootable_recovery-91f2dc252db41593a646402fd33652bf565daa9e.zip
bootable_recovery-91f2dc252db41593a646402fd33652bf565daa9e.tar.gz
bootable_recovery-91f2dc252db41593a646402fd33652bf565daa9e.tar.bz2
Fix segfault with dead symlinks
If a symlink pointed to a non-existing directory, the path navigation menu would crash when attempting to free the structs Change-Id: Icd6e7dcc711645f82c5ac014fcacd506b95a2fc2
-rw-r--r--extendedcommands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/extendedcommands.c b/extendedcommands.c
index 1a2e6d4..41ffe79 100644
--- a/extendedcommands.c
+++ b/extendedcommands.c
@@ -225,7 +225,7 @@ char** gather_files(const char* directory, const char* fileExtensionOrDirectory,
char fullFileName[PATH_MAX];
strcpy(fullFileName, directory);
strcat(fullFileName, de->d_name);
- stat(fullFileName, &info);
+ lstat(fullFileName, &info);
// make sure it is a directory
if (!(S_ISDIR(info.st_mode)))
continue;