aws / amazon-vpc-cni-plugins

VPC CNI plugins for Amazon ECS and EKS.
Apache License 2.0
68 stars 45 forks source link

vpc-branch-pat-eni: properly check for nil #67

Closed ElijahPepe closed 2 years ago

ElijahPepe commented 2 years ago

Description of changes: In the vpc-branch-pat-eni plugin, an optional branch IP address is parsed. In order to accomplish this, ipAddr is dereferenced. While err is checked against nil, the check is after ipAddr is dereferenced, which may result in a nil pointer dereference panic.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.