Reduce code churn

This commit is contained in:
Noah Stapp 2026-05-07 11:03:59 -04:00
parent 5f4a9a861f
commit 22854544d6

View File

@ -2155,7 +2155,7 @@ static PyObject* get_value(PyObject* self, PyObject* name, const char* buffer,
}
memcpy(&length, buffer + *position, 4);
length = BSON_UINT32_FROM_LE(length);
if (length > max - 5) { // Account for 5-byte header. max >= 5 guaranteed above
if (max - 5 < length) { // Account for 5-byte header. max >= 5 guaranteed above
goto invalid;
}