mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
Handle sign extended numbers in parsing variable length opcodes.
This commit is contained in:
parent
8a743c344a
commit
7ff3d5f871
@ -330,7 +330,9 @@ func parseScriptTemplate(script []byte, opcodemap map[byte]*opcode) ([]parsedOpc
|
||||
return nil, err
|
||||
}
|
||||
off = i + 1 - op.length // beginning of data
|
||||
if int(l) > len(script[off:]) {
|
||||
// Disallow entries that do not fit script or were
|
||||
// sign extended.
|
||||
if int(l) >= len(script[off:]) || int(l) < 0 {
|
||||
return retScript, StackErrShortScript
|
||||
}
|
||||
pop.data = script[off : off+int(l)]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user