mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix nil pointer dereference in nvproxy specutils
PiperOrigin-RevId: 609551204
This commit is contained in:
committed by
gVisor bot
parent
5f86d63fdd
commit
89ccdfe98a
@@ -98,9 +98,12 @@ func isNvidiaHookPresent(spec *specs.Spec, conf *config.Config) bool {
|
||||
// This has the effect of injecting the nvidia-container-runtime-hook.
|
||||
return true
|
||||
}
|
||||
for _, h := range spec.Hooks.Prestart {
|
||||
if strings.HasSuffix(h.Path, "/nvidia-container-runtime-hook") {
|
||||
return true
|
||||
|
||||
if spec.Hooks != nil {
|
||||
for _, h := range spec.Hooks.Prestart {
|
||||
if strings.HasSuffix(h.Path, "/nvidia-container-runtime-hook") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user