aboutsummaryrefslogtreecommitdiff
path: root/src/open_lib.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-05-29 15:47:08 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-05-29 15:47:39 +0200
commit5e9d68f716309fdab6fe2433ff0c129706cb2df3 (patch)
treea9b4f422c3375df2d84cf5bd1232d68ffadd38b5 /src/open_lib.cpp
parentfe3a8845e2def56cacfe74e3e4ea879189fc6b3b (diff)
downloadPROJ-5e9d68f716309fdab6fe2433ff0c129706cb2df3.tar.gz
PROJ-5e9d68f716309fdab6fe2433ff0c129706cb2df3.zip
pj_open_lib_ex(): avoid off-by-one reading of name argument if strlen(name) == 1 (fixes #1489)
Diffstat (limited to 'src/open_lib.cpp')
-rw-r--r--src/open_lib.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/open_lib.cpp b/src/open_lib.cpp
index 01f626e8..d161aa85 100644
--- a/src/open_lib.cpp
+++ b/src/open_lib.cpp
@@ -191,7 +191,7 @@ pj_open_lib_ex(projCtx ctx, const char *name, const char *mode,
else if (strchr(dir_chars,*name)
|| (*name == '.' && strchr(dir_chars,name[1]))
|| (!strncmp(name, "..", 2) && strchr(dir_chars,name[2]))
- || (name[1] == ':' && strchr(dir_chars,name[2])) )
+ || (name[0] != '\0' && name[1] == ':' && strchr(dir_chars,name[2])) )
sysname = name;
/* or try to use application provided file finder */