r5255 - in glibc-package/trunk/debian: . patches patches/hurd-i386
Author: sthibault
Date: 2012-05-20 21:04:11 +0000 (Sun, 20 May 2012)
New Revision: 5255
Added:
glibc-package/trunk/debian/patches/hurd-i386/submitted-sendto.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series
Log:
patches/hurd-i386/submitted-sendto.diff: New patch from Pino to fix
sendto() calls with NULL addr.
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2012-05-20 16:30:56 UTC (rev 5254)
+++ glibc-package/trunk/debian/changelog 2012-05-20 21:04:11 UTC (rev 5255)
@@ -21,6 +21,8 @@
* patches/hurd-i386/submitted-ptsname.diff: New patch from Pino to fix
buffer checks in ptsname.
* patches/hurd-i386/tg-hooks.diff: Add rules to sort _hurd_fork_locks.
+ * patches/hurd-i386/submitted-sendto.diff: New patch from Pino to fix
+ sendto() calls with NULL addr.
* control/{main,libc}: Remove libpthread-stubs-dev dependency on hurd-i386.
-- Clint Adams <clint@debian.org> Fri, 04 May 2012 23:39:00 -0400
Added: glibc-package/trunk/debian/patches/hurd-i386/submitted-sendto.diff
===================================================================
--- glibc-package/trunk/debian/patches/hurd-i386/submitted-sendto.diff (rev 0)
+++ glibc-package/trunk/debian/patches/hurd-i386/submitted-sendto.diff 2012-05-20 21:04:11 UTC (rev 5255)
@@ -0,0 +1,39 @@
+Hurd: sendto: do not crash when addr is NULL
+
+Work also when the specified addr is NULL; simplify also the usage of err.
+
+2012-05-20 Pino Toscano <toscano.pino@tiscali.it>
+
+ * sysdeps/mach/hurd/sendto.c: Consider also when addr is NULL.
+--- a/sysdeps/mach/hurd/sendto.c
++++ b/sysdeps/mach/hurd/sendto.c
+@@ -33,11 +33,11 @@ __sendto (int fd,
+ const struct sockaddr_un *addr,
+ socklen_t addr_len)
+ {
+- addr_port_t aport;
+- error_t err;
++ addr_port_t aport = MACH_PORT_NULL;
++ error_t err = 0;
+ size_t wrote;
+
+- if (addr->sun_family == AF_LOCAL)
++ if (addr != NULL && addr->sun_family == AF_LOCAL)
+ {
+ /* For the local domain, we must look up the name as a file and talk
+ to it with the ifsock protocol. */
+@@ -52,13 +52,11 @@ __sendto (int fd,
+ if (err)
+ return __hurd_fail (err);
+ }
+- else
+- err = EIEIO;
+
+ /* Get an address port for the desired destination address. */
+ err = HURD_DPORT_USE (fd,
+ ({
+- if (err)
++ if (aport == MACH_PORT_NULL && addr != NULL)
+ err = __socket_create_address (port,
+ addr->sun_family,
+ (char *) addr,
Modified: glibc-package/trunk/debian/patches/series
===================================================================
--- glibc-package/trunk/debian/patches/series 2012-05-20 16:30:56 UTC (rev 5254)
+++ glibc-package/trunk/debian/patches/series 2012-05-20 21:04:11 UTC (rev 5255)
@@ -203,6 +203,7 @@
hurd-i386/submitted-getgroups.diff
hurd-i386/submitted-getlogin_r.diff
hurd-i386/submitted-ptsname.diff
+hurd-i386/submitted-sendto.diff
kfreebsd/submitted-libc_once.diff
Reply to: