Commit be078a1
committed
Fix incorrect PyObject_CallFunction usage (remove extra NULL argument)
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>1 parent b1c9582 commit be078a1
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4067 | 4067 | | |
4068 | 4068 | | |
4069 | 4069 | | |
4070 | | - | |
| 4070 | + | |
4071 | 4071 | | |
4072 | 4072 | | |
4073 | 4073 | | |
| |||
0 commit comments