]> Cypherpunks repositories - gostls13.git/commit
net: improve error handling in dnsclient_unix.go
authormichael <info@komika.org>
Tue, 1 Feb 2022 14:41:20 +0000 (14:41 +0000)
committerGopher Robot <gobot@golang.org>
Sat, 7 May 2022 00:24:17 +0000 (00:24 +0000)
commit130775cd16d74401a2206218e2dc0f32d1c59898
tree5926f973a31b9c321a5b15840cb05a1e19abc5b1
parent4e79f06dac712d35d67d72777dae6df6d8c97888
net: improve error handling in dnsclient_unix.go

In the file net/dnsclient_unix.go in the function newRequest
error handling is missing after calling b.Finish(). If
the implementation of dnsmessage.Builder.Finish changes
it is theoretically possible that the missing error handling
introduces a nil pointer exception.

Fixes #50946

Change-Id: I3f0785f71def6649d6089d0af71c9e50f5ccb259
GitHub-Last-Rev: 2a2197f7e6d18d5477967b299ed734a7b224536d
GitHub-Pull-Request: golang/go#50948
Reviewed-on: https://go-review.googlesource.com/c/go/+/381966
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/net/dnsclient_unix.go