From 5e9d68f716309fdab6fe2433ff0c129706cb2df3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 29 May 2019 15:47:08 +0200 Subject: pj_open_lib_ex(): avoid off-by-one reading of name argument if strlen(name) == 1 (fixes #1489) --- src/open_lib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/open_lib.cpp') 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 */ -- cgit v1.2.3