This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 2/2] cygwin: add Object Size Checking to sys/socket.h
- From: Yaakov Selkowitz <yselkowi at redhat dot com>
- To: cygwin-patches at cygwin dot com
- Date: Wed, 29 Nov 2017 11:45:27 -0600
- Subject: [PATCH 2/2] cygwin: add Object Size Checking to sys/socket.h
- Authentication-results: sourceware.org; auth=none
- References: <20171129174527.10536-1-yselkowi@redhat.com>
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
---
winsup/cygwin/include/ssp/socket.h | 20 ++++++++++++++++++++
winsup/cygwin/include/sys/socket.h | 4 ++++
2 files changed, 24 insertions(+)
create mode 100644 winsup/cygwin/include/ssp/socket.h
diff --git a/winsup/cygwin/include/ssp/socket.h b/winsup/cygwin/include/ssp/socket.h
new file mode 100644
index 000000000..3abbddbdf
--- /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 8bab35b68..9e897a9ff 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 */
--
2.15.0