Potential Bug When First Character In Path Is Unicode (#398)

Fix is_absolute_path() to ignore non-ASCII values.
This commit is contained in:
Bryan Berns 2019-12-09 14:31:22 -05:00 committed by bagajjal
parent 8cf6003bac
commit 25588ffb7a
1 changed files with 1 additions and 1 deletions

View File

@ -1391,7 +1391,7 @@ is_absolute_path(const char *path)
if(*path == '\"' || *path == '\'') /* skip double quote if path is "c:\abc" */
path++;
if (*path == '/' || *path == '\\' || (*path != '\0' && isalpha(*path) && path[1] == ':') ||
if (*path == '/' || *path == '\\' || (*path != '\0' && __isascii(*path) && isalpha(*path) && path[1] == ':') ||
((strlen(path) >= strlen(PROGRAM_DATA)) && (memcmp(path, PROGRAM_DATA, strlen(PROGRAM_DATA)) == 0)))
retVal = 1;