diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-05-29 15:47:08 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-05-29 15:47:08 +0200 |
| commit | 2eb2798b1ef31d04c717856d82acd4ccb7aac78a (patch) | |
| tree | 673842e844a4ee3f0d16bcaefe7dc57adce0fde9 /src/open_lib.cpp | |
| parent | 24be089a0f91eca76504d7d56b469d1d4dcbbeab (diff) | |
| download | PROJ-2eb2798b1ef31d04c717856d82acd4ccb7aac78a.tar.gz PROJ-2eb2798b1ef31d04c717856d82acd4ccb7aac78a.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.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/open_lib.cpp b/src/open_lib.cpp index 91b66feb..05e01db2 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 */ |
