Skip to content

Commit

Permalink
fuzzing: don't accept out-of-range repr ids
Browse files Browse the repository at this point in the history
also: accept 0 as repr id (it's MVMString)
  • Loading branch information
timo committed Apr 18, 2019
1 parent 7b112da commit 275098a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/6model/reprs/P6opaque.c
Expand Up @@ -1035,7 +1035,7 @@ static void deserialize_repr_data(MVMThreadContext *tc, MVMSTable *st, MVMSerial
for (i = 0; i < repr_data->num_attributes; i++) {
MVMuint16 repr_id = MVM_serialization_read_int(tc, reader);
MVMuint16 slot = MVM_serialization_read_int(tc, reader);
if (repr_id)
if (repr_id < MVM_REPR_MAX_COUNT)
repr_data->unbox_slots[repr_id] = slot;
}
} else {
Expand Down

0 comments on commit 275098a

Please sign in to comment.