Skip to content

Commit 7e49c6e

Browse files
committed
Fix uninitialized memory read reported by Valgrind when running doctest.
This could happen if size == 0.
1 parent 41efc14 commit 7e49c6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Objects/codeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds)
556556
the line increments here, treating them as byte
557557
increments gets confusing, to say the least. */
558558

559+
bounds->ap_lower = 0;
559560
while (size > 0) {
560561
if (addr + *p > lasti)
561562
break;

0 commit comments

Comments
 (0)