PyLong_FromString(): fix Coverity CID 1424951 (#4738) · pythoncapi/cpython@dd431b3 · GitHub
Skip to content

Commit dd431b3

Browse files
authored
PyLong_FromString(): fix Coverity CID 1424951 (python#4738)
Explicitly cast digits (Py_ssize_t) to double to fix the following false-alarm warning from Coverity: "fsize_z = digits * log_base_BASE[base] + 1;" CID 1424951: Incorrect expression (UNINTENDED_INTEGER_DIVISION) Dividing integer expressions "9223372036854775783UL" and "4UL", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.
1 parent a0374dd commit dd431b3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Objects/longobject.c

Lines changed: 2 additions & 3 deletions

0 commit comments

Comments
 (0)