From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Tue, 22 Apr 2025 13:06:30 +0000 (+0200) Subject: GH-131296: Avoid invalid signed char comparison in getpath.c assertion (GH-131594) X-Git-Tag: v3.14.0b1~362 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f663b2c56a2eecc258d2abd54ed33836d070e6f5;p=thirdparty%2FPython%2Fcpython.git GH-131296: Avoid invalid signed char comparison in getpath.c assertion (GH-131594) --- diff --git a/Modules/getpath.c b/Modules/getpath.c index e2478da021f5..1e75993480ae 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -690,7 +690,7 @@ env_to_dict(PyObject *dict, const char *key, int and_clear) // Quick convert to wchar_t, since we know key is ASCII wchar_t *wp = wkey; for (const char *p = &key[4]; *p; ++p) { - assert(*p < 128); + assert(!(*p & 0x80)); *wp++ = *p; } *wp = L'\0';