Skip to content

Commit d48dd67

Browse files
committed
that's it?
1 parent d4eee16 commit d48dd67

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Modules/_remote_debugging/binary_io_reader.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,14 @@ reader_get_or_create_thread_state(BinaryReader *reader, uint64_t thread_id,
563563
}
564564
}
565565

566+
if (reader->thread_state_count >= reader->thread_count) {
567+
PyErr_Format(PyExc_ValueError,
568+
"Invalid thread count: sample data contains more unique threads than declared in header "
569+
"(declared %u, found at least %zu)",
570+
reader->thread_count, reader->thread_state_count + 1);
571+
return NULL;
572+
}
573+
566574
if (!reader->thread_states) {
567575
reader->thread_state_capacity = 16;
568576
reader->thread_states = PyMem_Calloc(reader->thread_state_capacity, sizeof(ReaderThreadState));

0 commit comments

Comments
 (0)