summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-08 04:21:02 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-02-08 04:21:02 +0100
commit391c9d80dba7e30b164bc6217a0ee18f6039eea9 (patch)
tree6b2b1f7aca6a9b9ae13f4e07e68e0899407bf61a
parent572e194e455b8b7d394bcbcea2f156f02714bffe (diff)
Rework patch
-rw-r--r--.topmsg4
-rw-r--r--hurd/hurdsocket.h12
2 files changed, 11 insertions, 5 deletions
diff --git a/.topmsg b/.topmsg
index 2d1414fa1b..f87538b546 100644
--- a/.topmsg
+++ b/.topmsg
@@ -1,9 +1,7 @@
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Subject: [PATCH] Fix connect/sendto/sendmsg into making sure to ignore bytes beyond sockaddr length
-2014-03-01 Samuel Thibault <samuel.thibault@ens-lyon.org>
-
-Thanks Tanaka Akira for the report.
+ [BZ #17944]
* hurd/hurdsocket.h: New file, defines _hurd_sun_path_dupa which
duplicates ADDR->sun_path with sockaddr LEN limitation.
diff --git a/hurd/hurdsocket.h b/hurd/hurdsocket.h
index fd45f34238..611c18eb76 100644
--- a/hurd/hurdsocket.h
+++ b/hurd/hurdsocket.h
@@ -16,7 +16,15 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _HURD_HURDSOCKET_H
+#define _HURD_HURDSOCKET_H
+
#include <string.h>
-#define _hurd_sun_path_dupa(__addr, __len) \
- strndupa ((__addr)->sun_path, (__len) - offsetof (struct sockaddr_un, sun_path))
+/* Returns a duplicate of ADDR->sun_path with LEN limitation. This
+ should to be used whenever reading a unix socket address, to cope with
+ sun_path possibly not including a trailing \0. */
+#define _hurd_sun_path_dupa(addr, len) \
+ strndupa ((addr)->sun_path, (len) - offsetof (struct sockaddr_un, sun_path))
+
+#endif /* hurdsocket.h */