Skip to content

Commit 44a5734

Browse files
HyperPSJibola
andauthored
Fix: prevent signed integer overflow in OP_MSG message sizes (#2693)
Co-authored-by: Jib <Jibzade@gmail.com> Co-authored-by: Jib <jib.adegunloye@mongodb.com>
1 parent 206ef2e commit 44a5734

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pymongo/_cmessagemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static PyObject* _error(char* name) {
6060
* Returns 0 on failure */
6161
static int buffer_write_bytes_ssize_t(buffer_t buffer, const char* data, Py_ssize_t size) {
6262
int downsize = _downcast_and_check(size, 0);
63-
if (size == -1) {
63+
if (downsize == -1) {
6464
return 0;
6565
}
6666
return buffer_write_bytes(buffer, data, downsize);

0 commit comments

Comments
 (0)