https://github.com/python/cpython/commit/f663b2c56a2eecc258d2abd54ed33836d070e6f5
commit: f663b2c56a2eecc258d2abd54ed33836d070e6f5
branch: main
author: Chris Eibl <138194463+chris-e...@users.noreply.github.com>
committer: zooba <steve.do...@microsoft.com>
date: 2025-04-22T14:06:30+01:00
summary:

GH-131296: Avoid invalid signed char comparison in getpath.c assertion 
(GH-131594)

files:
M Modules/getpath.c

diff --git a/Modules/getpath.c b/Modules/getpath.c
index e2478da021f511..1e75993480ae36 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';

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to