summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2010-07-19 12:45:33 +0200
committerYorhel <git@yorhel.nl>2010-07-19 12:45:33 +0200
commit9f7bc01f11545c890b12655b4a832dcf3b6d2178 (patch)
treea4d5253b14f8651f282df2476d69db96d93e66d3
parent4d188cb9a26ef0587de2d2130627fda7730d55b9 (diff)
Fixed segfault when launched on a nonexistant directory
Forgot to check the return value of path_absolute() in path_real(), path_absolute() would return an error when getcwd() fails. Fixes bug #3012787.
-rw-r--r--ChangeLog1
-rw-r--r--src/path.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f196d6b..dc819ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@ git - ?
- Count the size of a hard linked file once for each directory it appears in
- Fixed crash on browsing dirs with a small window size (#2991787)
- Fixed buffer overflow when some directories can't be scanned (#2981704)
+ - Fixed segfault when launched on a nonexistant directory (#3012787)
- Fixed segfault when root dir only contains hidden files
- Improved browsing performance
- More intuitive multi-page browsing
diff --git a/src/path.c b/src/path.c
index 24243d6..98a7a17 100644
--- a/src/path.c
+++ b/src/path.c
@@ -201,7 +201,8 @@ char *path_real(const char *orig) {
if(orig == NULL)
return NULL;
- tmp = path_absolute(orig);
+ if((tmp = path_absolute(orig)) == NULL)
+ return NULL;
ret = path_real_rec(tmp, &links);
free(tmp);
return ret;