Skip to content

Commit

Permalink
fix minimal data
Browse files Browse the repository at this point in the history
  • Loading branch information
bloomingpeach committed Sep 23, 2024
1 parent 13f6cf4 commit 0ad86a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/engine/src/engine.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ pub impl EngineInternalImpl of EngineInternalTrait {
let script = *(self.scripts[self.script_idx]);
if opcode == Opcode::OP_DATA_1 {
let value: u8 = script.at(self.opcode_idx + 1).unwrap();
if value <= 16 {
if value >= 1 && value <= 16 {
// Should be OP_1 to OP_16
return Result::Err(Error::MINIMAL_DATA);
}
Expand All @@ -756,6 +756,7 @@ pub impl EngineInternalImpl of EngineInternalTrait {
return Result::Err(Error::MINIMAL_DATA);
}
}

// TODO: More checks?
if !Opcode::is_push_opcode(opcode) {
return Result::Ok(());
Expand Down

0 comments on commit 0ad86a4

Please sign in to comment.