You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Possible (benign) overflow for 'K' format code in do_mkvalue #132909
This is probably not an issue but here are the known "temporary" overflows:
// format = 'K'returnPyLong_FromUnsignedLongLong((long long)va_arg(*p_va, unsignedlong long));
Note that va_arg(*p_va, unsigned long long) will be converted into an unsigned long long, and then into a long long, and then back to an unsigned long long. So if we were to have an overflow here, it shouldn't really matter. Indeed, take v = (1ULL << 63) + 2. We have:
unsigned long longv2=va_arg(*p_va, unsignedlong long);
// v2 = 9223372036854775810long longv3= (long long)v2;
// v3 = -9223372036854775806PyObject*v4=PyLong_FromUnsignedLongLong(v3);
// v4 = 9223372036854775810 as PyObject as v3 was casted back to an unsigned long long
changed the title [-]Possible (benign) overflows for 'K' and 'u' format codes in `do_mkvalue`[/-][+]Possible (benign) overflow for 'K' format codes in `do_mkvalue`[/+]on Apr 25, 2025
changed the title [-]Possible (benign) overflow for 'K' format codes in `do_mkvalue`[/-][+]Possible (benign) overflow for 'K' format code in `do_mkvalue`[/+]on Apr 25, 2025
Activity
serhiy-storchaka commentedon Apr 25, 2025
wchar_tis at least 2 bytes on platforms supported by Python.wcslen()never returns result larger thanSSIZE_MAX = SIZE_MAX/2.[-]Possible (benign) overflows for 'K' and 'u' format codes in `do_mkvalue`[/-][+]Possible (benign) overflow for 'K' format codes in `do_mkvalue`[/+][-]Possible (benign) overflow for 'K' format codes in `do_mkvalue`[/-][+]Possible (benign) overflow for 'K' format code in `do_mkvalue`[/+]gh-132909: handle overflow for `'K'` format in `do_mkvalue` (#132911)
[3.13] gh-132909: handle overflow for `'K'` format in `do_mkvalue` (G…