shall we restrict the size of input in btcec.FieldVal.SetByteSlice(b []byte)? #1170
Closed
Description
According to the comment, " Only the first 32-bytes are used. As a result, it is up to the caller to ensure numbers of the appropriate size are used or the value will be truncated."
However, in the code:
for i := 0; i < len(b); i++ {
if i < 32 {
b32[i+(32-len(b))] = b[i]
}
}
This will crash if len(b) > 32. Shall we add
b = b[:32]
?
Metadata
Assignees
Labels
No labels