Skip to content

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Sep 5, 2024

PYTHON-4663

First warning:

1. returned_null: PyModule_GetState returns NULL (checked 18 out of 19 times).
     	2. var_assigned: Assigning: state = NULL return value from PyModule_GetState.
389    struct module_state *state = GETSTATE(self);

Second:

CID 162119: (#2 of 2): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)
overflow_before_widen: Potentially overflowing expression ((PyDateTime_Delta *)utcoffset)->days * 86400 with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type int64_t (64 bits, signed).
     	To avoid overflow, cast either ((PyDateTime_Delta *)utcoffset)->days or 86400 to type int64_t.
417                min_millis_offset = (PyDateTime_DELTA_GET_DAYS(utcoffset) * 86400 +
418                                     PyDateTime_DELTA_GET_SECONDS(utcoffset)) * 1000 +
419                                     (PyDateTime_DELTA_GET_MICROSECONDS(utcoffset) / 1000);

Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ShaneHarvey ShaneHarvey merged commit 3504130 into mongodb:master Sep 5, 2024
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants