summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_file/ecore_file.c
diff options
context:
space:
mode:
authorEric Schuele <ravenlock@ravenlock.us>2008-04-17 02:04:02 +0000
committerEric Schuele <ravenlock@ravenlock.us>2008-04-17 02:04:02 +0000
commitc48d02e391d9e3a9f8160b5e0159ca3b3f1cacff (patch)
tree06e699c8a58a3fc59c596e1549ba0044c16d595f /legacy/ecore/src/lib/ecore_file/ecore_file.c
parent6dd6b76c0a3a23346138a47b4a5e2739e429336b (diff)
Check for null pointer before passing to realpath()
SVN revision: 34285
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file.c b/legacy/ecore/src/lib/ecore_file/ecore_file.c
index 8c2c8c646a..c0298084f8 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file.c
@@ -459,6 +459,11 @@ ecore_file_realpath(const char *file)
459{ 459{
460 char buf[PATH_MAX]; 460 char buf[PATH_MAX];
461 461
462 /*
463 * Some implementations of realpath do not conform to the SUS.
464 * And as a result we must prevent a null arg from being passed.
465 */
466 if (!file) return strdup("");
462 if (!realpath(file, buf)) return strdup(""); 467 if (!realpath(file, buf)) return strdup("");
463 468
464 return strdup(buf); 469 return strdup(buf);