From f663b2c56a2eecc258d2abd54ed33836d070e6f5 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Tue, 22 Apr 2025 15:06:30 +0200 Subject: [PATCH] GH-131296: Avoid invalid signed char comparison in getpath.c assertion (GH-131594) --- Modules/getpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/getpath.c b/Modules/getpath.c index e2478da021f..1e75993480a 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';