openbsd-ports/x11/wxWidgets/patches/patch-src_unix_gsocket_cpp
dcoppa 9637d13311 Update to wxWidgets-2.8.12.
Tested in a bulk build by landry@
OK rpointel@, landry@
2011-05-22 08:13:18 +00:00

19 lines
723 B
Plaintext

$OpenBSD: patch-src_unix_gsocket_cpp,v 1.3 2011/05/22 08:13:18 dcoppa Exp $
The socket code in wxWidgets doesn't initialize the servent_data
structure that is passed to getservbyname_r(). Programs that use this
code die with a segfault. The attached patch zero-fills the buffer with
memset().
See upstream bugreport #10332.
--- src/unix/gsocket.cpp.orig Tue Mar 22 13:01:28 2011
+++ src/unix/gsocket.cpp Wed May 18 10:52:51 2011
@@ -2145,6 +2145,7 @@ GSocketError GAddress_INET_SetPortName(GAddress *addre
char buffer[1024];
#endif
struct servent serv;
+ memset(&buffer, 0, sizeof(buffer));
se = wxGetservbyname_r(port, protocol, &serv,
(void*)&buffer, sizeof(buffer));
if (!se)