This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] cygwin: add Object Size Checking to sys/socket.h
- From: Yaakov Selkowitz <yselkowitz at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 30 Nov 2017 10:07:18 -0000
- Subject: [newlib-cygwin] cygwin: add Object Size Checking to sys/socket.h
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=da4839ec18cac49fc1c2cee732104c7dabdc2d4c
commit da4839ec18cac49fc1c2cee732104c7dabdc2d4c
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date: Wed Nov 29 11:38:54 2017 -0600
cygwin: add Object Size Checking to sys/socket.h
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diff:
---
winsup/cygwin/include/ssp/socket.h | 20 ++++++++++++++++++++
winsup/cygwin/include/sys/socket.h | 4 ++++
2 files changed, 24 insertions(+)
diff --git a/winsup/cygwin/include/ssp/socket.h b/winsup/cygwin/include/ssp/socket.h
new file mode 100644
index 0000000..3abbddb
--- /dev/null
+++ b/winsup/cygwin/include/ssp/socket.h
@@ -0,0 +1,20 @@
+#ifndef _SSP_SOCKET_H_
+#define _SSP_SOCKET_H_
+
+#include <ssp/ssp.h>
+
+#if __SSP_FORTIFY_LEVEL > 0
+__BEGIN_DECLS
+
+__ssp_redirect0(ssize_t, recv, \
+ (int __fd, void *__buf, size_t __len, int __flags), \
+ (__fd, __buf, __len, __flags));
+
+__ssp_redirect0(ssize_t, recvfrom, \
+ (int __fd, void *__buf, size_t __len, int __flags, struct sockaddr *__from, socklen_t *__fromlen), \
+ (__fd, __buf, __len, __flags, __from, __fromlen));
+
+__END_DECLS
+
+#endif /* __SSP_FORTIFY_LEVEL > 0 */
+#endif /* _SSP_SOCKET_H_ */
diff --git a/winsup/cygwin/include/sys/socket.h b/winsup/cygwin/include/sys/socket.h
index 8bab35b..9e897a9 100644
--- a/winsup/cygwin/include/sys/socket.h
+++ b/winsup/cygwin/include/sys/socket.h
@@ -50,4 +50,8 @@ extern "C"
};
#endif
+#if __SSP_FORTIFY_LEVEL > 0
+#include <ssp/socket.h>
+#endif
+
#endif /* _SYS_SOCKET_H */