Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3fa024d

Browse files
authored
gh-132909: handle overflow for'K' format indo_mkvalue (#132911)
1 parentde6482e commit3fa024d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

‎Doc/c-api/arg.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ Building values
669669
``L`` (:class:`int`) [long long]
670670
Convert a C :c:expr:`long long` to a Python integer object.
671671
672+
.. _capi-py-buildvalue-format-K:
673+
672674
``K`` (:class:`int`) [unsigned long long]
673675
Convert a C :c:expr:`unsigned long long` to a Python integer object.
674676
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an overflow when handling the:ref:`K<capi-py-buildvalue-format-K>` format
2+
in:c:func:`Py_BuildValue`. Patch by Bénédikt Tran.

‎Python/modsupport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,8 @@ do_mkvalue(const char **p_format, va_list *p_va)
321321
returnPyLong_FromLongLong((long long)va_arg(*p_va,longlong));
322322

323323
case'K':
324-
returnPyLong_FromUnsignedLongLong((long long)va_arg(*p_va,unsignedlong long));
324+
returnPyLong_FromUnsignedLongLong(
325+
va_arg(*p_va,unsignedlong long));
325326

326327
case'u':
327328
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp