golang / go

The Go programming language

Home Page:https://go.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

encoding/gob: makeslice: len out of range

dvyukov opened this issue · comments

The following modest-size inputs either crash encoding/gob or equally can be used to make a server allocate a huge chunk of memory and die due to swapping:
http://play.golang.org/p/OX1r_k14v4
http://play.golang.org/p/f3h2HfdIDD
http://play.golang.org/p/pPZcalWmMF

The issue happens in various "ignore" functions:
encoding/gob.ignoreUint8Array(0x104351c0, 0x10435200, 0x0, 0x0, 0x0, 0xc00)
encoding/gob.(_Decoder).ignoreInterface(0x1040e320, 0x104351c0)
encoding/gob.(_Decoder).ignoreGobDecoder(0x1040e320, 0x10435920)
There can be others as well.

Happens with both go14 (playground) and tip.

Rob, you fixed only the first input. Second and third still crash.