* libgo patch committed: Check Getsockname error return
@ 2017-09-27 14:22 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2017-09-27 14:22 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 169 bytes --]
This patch by Tony Reix checks for errors from Getsockname in a couple
of places. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1272 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 253105)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-e0c1f0b645b12a544b484c0f477f8fb6f5980550
+cdf1f58c7578980e1d1949680c7e404961b7c153
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: libgo/go/net/sock_posix.go
===================================================================
--- libgo/go/net/sock_posix.go (revision 253025)
+++ libgo/go/net/sock_posix.go (working copy)
@@ -182,7 +182,10 @@ func (fd *netFD) listenStream(laddr sock
if err := fd.init(); err != nil {
return err
}
- lsa, _ := syscall.Getsockname(fd.pfd.Sysfd)
+ lsa, err := syscall.Getsockname(fd.pfd.Sysfd)
+ if err != nil {
+ return os.NewSyscallError("getsockname", err)
+ }
fd.setAddr(fd.addrFunc()(lsa), nil)
return nil
}
@@ -221,7 +224,10 @@ func (fd *netFD) listenDatagram(laddr so
if err := fd.init(); err != nil {
return err
}
- lsa, _ := syscall.Getsockname(fd.pfd.Sysfd)
+ lsa, err := syscall.Getsockname(fd.pfd.Sysfd)
+ if err != nil {
+ return os.NewSyscallError("getsockname", err)
+ }
fd.setAddr(fd.addrFunc()(lsa), nil)
return nil
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-27 14:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-27 14:22 libgo patch committed: Check Getsockname error return Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).