diff options
| author | Alex Chan <alexc@tailscale.com> | 2025-10-03 14:08:50 +0100 |
|---|---|---|
| committer | Alex Chan <alex@alexwlchan.net> | 2025-10-03 16:21:34 +0100 |
| commit | 304dabce17cbde7698568c8144159c2b4f8ad9b1 (patch) | |
| tree | 37481e45240e782e865a69058f497e8b042c190c /util/execqueue/execqueue_test.go | |
| parent | 206d98e84be6cc309f3fbe9eb34844f0c7883a28 (diff) | |
| download | tailscale-304dabce17cbde7698568c8144159c2b4f8ad9b1.tar.xz tailscale-304dabce17cbde7698568c8144159c2b4f8ad9b1.zip | |
ipn/ipnauth: fix a null pointer panic in GetConnIdentity
When running integration tests on macOS, we get a panic from a nil
pointer dereference when calling `ci.creds.PID()`.
This panic occurs because the `ci.creds != nil` check is insufficient
after a recent refactoring (c45f881) that changed `ci.creds` from a
pointer to the `PeerCreds` interface. Now `ci.creds` always compares as
non-nil, so we enter this block even when the underlying value is nil.
The integration tests fail on macOS when `peercred.Get()` returns the
error `unix.GetsockoptInt: socket is not connected`. This error isn't
new, and the previous code was ignoring it correctly.
Since we trust that `peercred` returns either a usable value or an error,
checking for a nil error is a sufficient and correct gate to prevent the
method call and avoid the panic.
Fixes #17421
Signed-off-by: Alex Chan <alexc@tailscale.com>
Diffstat (limited to 'util/execqueue/execqueue_test.go')
0 files changed, 0 insertions, 0 deletions
