mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 09:50:08 +01: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