mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix panic on nil map in Fragmentation.
A rare bug occurs when assigning a value to the reassemblers map causes a panic due to the map being nil. The only way this is possible is if Fragmentation.Release() is called before Process() is able to finish. PiperOrigin-RevId: 466771159
This commit is contained in:
committed by
gVisor bot
parent
778db1d8bc
commit
a4fb3b200f
@@ -175,6 +175,10 @@ func (f *Fragmentation) Process(
|
||||
}
|
||||
|
||||
f.mu.Lock()
|
||||
if f.reassemblers == nil {
|
||||
return nil, 0, false, fmt.Errorf("Release() called before fragmentation processing could finish")
|
||||
}
|
||||
|
||||
r, ok := f.reassemblers[id]
|
||||
if !ok {
|
||||
r = newReassembler(id, f.clock)
|
||||
|
||||
Reference in New Issue
Block a user