Commit 767a9af
committed
libpod: fix nil pointer dereference in getHostsEntries
When NetMode.IsPasta() is true but pastaResult is nil (which can happen
during container setup failures or in certain edge cases), accessing
c.pastaResult.IPAddresses causes a panic.
Add a nil check for c.pastaResult before accessing its fields, matching
the pattern used elsewhere in the codebase.
Fixes rootless test failures in PR #27338.
Signed-off-by: Lokesh Mandvekar <[email protected]>1 parent ce0ef49 commit 767a9af
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2350 | 2350 | | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | | - | |
| 2353 | + | |
2354 | 2354 | | |
2355 | 2355 | | |
2356 | 2356 | | |
| |||
0 commit comments