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
The codebase currently lacks NULL checks after calls to PyTuple_Pack, which can return NULL on error. This issue poses a bug risk as it can lead to unexpected behavior or crashes if the error is not handled properly.
The specific instance mentioned is in the code where PyTuple_Pack is used without checking for a NULL return value. The suggested fix is to add a NULL check immediately after the PyTuple_Pack call, as follows:
PyObject*tuple=PyTuple_Pack(2, path, retval);
if (tuple==NULL) {
returnNULL;
}
Additionally, there are other files such as kvitems_basecoro.c and parse_basecoro.c that also lack these checks. It is recommended to perform a comprehensive review and update all instances where PyTuple_Pack is used without a NULL check across the codebase. A separate commit addressing all these instances would be beneficial to ensure consistency and robustness in error handling.
The codebase currently lacks NULL checks after calls to
PyTuple_Pack
, which can return NULL on error. This issue poses a bug risk as it can lead to unexpected behavior or crashes if the error is not handled properly.The specific instance mentioned is in the code where
PyTuple_Pack
is used without checking for a NULL return value. The suggested fix is to add a NULL check immediately after thePyTuple_Pack
call, as follows:Additionally, there are other files such as
kvitems_basecoro.c
andparse_basecoro.c
that also lack these checks. It is recommended to perform a comprehensive review and update all instances wherePyTuple_Pack
is used without a NULL check across the codebase. A separate commit addressing all these instances would be beneficial to ensure consistency and robustness in error handling.I created this issue for @wodny from #127 (comment).
Tips and commands
Interacting with Sourcery
@sourcery-ai plan
on this issue.@sourcery-ai develop
togenerate a PR that addresses this issue.
Getting Help
The text was updated successfully, but these errors were encountered: