Skip to content

Commit 643a614

Browse files
committed
Check bounds before data
1 parent 588d5fe commit 643a614

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/codeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
342342
memcpy(_PyCode_CODE(co), PyBytes_AS_STRING(con->code),
343343
PyBytes_GET_SIZE(con->code));
344344
int entry_point = 0;
345-
while (_Py_OPCODE(_PyCode_CODE(co)[entry_point]) != RESUME &&
346-
entry_point < Py_SIZE(co)) {
345+
while (entry_point < Py_SIZE(co) &&
346+
_Py_OPCODE(_PyCode_CODE(co)[entry_point]) != RESUME) {
347347
entry_point++;
348348
}
349349
co->_co_firsttraceable = entry_point;

0 commit comments

Comments
 (0)