🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@hyongtao-code
Copy link

@hyongtao-code hyongtao-code commented Dec 11, 2025

This PR fixes incorrect calls to PyObject_CallFunction where an extra NULL argument was passed despite the format string already specifying the complete argument list.
PyObject_CallFunction does not use a NULL terminator; it relies solely on the format string to determine how many arguments to read. Providing more arguments than required results in undefined behavior due to va_list misalignment.

The affected calls:

  • PyImport_Import() — "OOOOi" was given 6 arguments instead of 5
  • deque_copy() — "Oi" was given 3 arguments instead of 2

Both have been corrected by removing the superfluous NULL. No functional changes beyond fixing the API misuse.

This PR fixes incorrect calls to PyObject_CallFunction where an
extra NULL argument was passed despite the format string already
specifying the complete argument list.
PyObject_CallFunction does not use a NULL terminator; it relies
solely on the format string to determine how many arguments to read.
Providing more arguments than required results in undefined behavior
due to va_list misalignment.

The affected calls:
- PyImport_Import() — "OOOOi" was given 6 arguments instead of 5
- deque_copy() — "Oi" was given 3 arguments instead of 2

Both have been corrected by removing the superfluous NULL.
No functional changes beyond fixing the API misuse.

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
@python-cla-bot
Copy link

python-cla-bot bot commented Dec 11, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Dec 11, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@hyongtao-code hyongtao-code changed the title gh142606: Fix extra NULL arguments passed to PyObject_CallFunction gh-142606: Fix extra NULL arguments passed to PyObject_CallFunction Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant