Skip to content

Commit

Permalink
fix: ipam invalid memory address or nil pointer dereference (#3889)
Browse files Browse the repository at this point in the history
Signed-off-by: zcq98 <zhaocongqi_yewu@cmss.chinamobile.com>
  • Loading branch information
zhaocongqi authored and oilbeater committed Mar 29, 2024
1 parent c207eca commit 6609c81
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ipam/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ func (s *Subnet) GetStaticAddress(podName, nicName string, ip IP, mac *string, f
}
}

if pool == nil {
return ip, "", ErrOutOfRange
}

defer func() {
s.pushPodNic(podName, nicName)
if isAllocated {
Expand Down

0 comments on commit 6609c81

Please sign in to comment.