From 25588ffb7a3460cca3a4137ac8a8b8ec85c207ec Mon Sep 17 00:00:00 2001 From: Bryan Berns Date: Mon, 9 Dec 2019 14:31:22 -0500 Subject: [PATCH] Potential Bug When First Character In Path Is Unicode (#398) Fix is_absolute_path() to ignore non-ASCII values. --- contrib/win32/win32compat/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/misc.c b/contrib/win32/win32compat/misc.c index 2e8a8f52f..552c19f09 100644 --- a/contrib/win32/win32compat/misc.c +++ b/contrib/win32/win32compat/misc.c @@ -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;