9637d13311
Tested in a bulk build by landry@ OK rpointel@, landry@
19 lines
723 B
Plaintext
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)
|