Skip to content

Commit a5da9f0

Browse files
committed
[refactoring] Make sure to not read out of buffer limits
1 parent 8a1f8be commit a5da9f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/ssl-ref-client/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func main() {
4141
log.Fatal("Buffer size too small")
4242
}
4343
refMsg := refproto.Referee{}
44-
proto.Unmarshal(b, &refMsg)
44+
proto.Unmarshal(b[0:n], &refMsg)
4545

4646
b, err := json.Marshal(refMsg)
4747
if err != nil {

0 commit comments

Comments
 (0)