Remove Py_SSIZE2SIZE to quiet cppcheck warnings.

Tuple size cannot be negative and we already handle the case where
it is zero.
This commit is contained in:
Todd C. Miller
2021-01-26 11:33:06 -07:00
parent 19d5845f8b
commit bca213959b
4 changed files with 4 additions and 4 deletions

View File

@@ -346,11 +346,12 @@ python_sudo_conversation(PyObject *Py_UNUSED(self), PyObject *py_args, PyObject
goto cleanup;
}
/* sudo_module_ConvMessages_to_c() returns error if no messages. */
if (sudo_module_ConvMessages_to_c(py_args, &num_msgs, &msgs) < 0) {
goto cleanup;
}
replies = calloc(Py_SSIZE2SIZE(num_msgs), sizeof(struct sudo_conv_reply));
replies = calloc(num_msgs, sizeof(struct sudo_conv_reply));
if (replies == NULL)
goto cleanup;
py_result = PyTuple_New(num_msgs);