mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Check for valid nfds before copying in an fd set.
Otherwise, CopyInFDSet will try to allocate a negative-length slice. PiperOrigin-RevId: 286584907
This commit is contained in:
@@ -36,6 +36,9 @@ func fdsFromSet(t *kernel.Task, set []byte) []int {
|
||||
}
|
||||
|
||||
func fdSet(t *kernel.Task, nfds int, addr usermem.Addr) string {
|
||||
if nfds < 0 {
|
||||
return fmt.Sprintf("%#x (negative nfds)", addr)
|
||||
}
|
||||
if addr == 0 {
|
||||
return "null"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user