[ wxwindows-Bugs-1530952 ] wxSocket: GetAddressFromName should set sa_family, sa_data

SourceForge.net noreply at sourceforge.net
Sat Jul 29 10:31:47 PDT 2006


Bugs item #1530952, was opened at 2006-07-29 17:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1530952&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Alex Bligh (abligh)
Assigned to: Nobody/Anonymous (nobody)
Summary: wxSocket: GetAddressFromName should set sa_family, sa_data

Initial Comment:
The following valgrind chunk illustrates the problem:

==5445== Syscall param
socketcall.bind(my_addr..sin_port) points to
uninitialised byte(s)
==5445==    at 0x4000772: (within /lib/ld-2.3.6.so)
==5445==    by 0x8C262C2:
wxSocketServer::wxSocketServer(wxSockAddress&, int) (in
/home/jlh92/Desktop/1596/XaraLXnotStripped)
==5445==    by 0x8C23088: wxTCPServer::Create(wxString
const&) (in /home/jlh92/Desktop/1596/XaraLXnotStripped)
==5445==    by 0x805EF3C: CCamApp::OnInit()
(camelot.cpp:1022)

The relevant call is to wxServer::Create() with a name
of  "PROGRAME-NAME-HERE.ipc". GetAddressFromName
correctly identifies there is no address. However, it
does not zero the address field. This causes
wxSocketServer's constructor to pass data into
GSocket_new() which is unitialized. Ultimately this
unitialized data ends up being passed to the kernel as
a syscall parameter. This would seem not to be a good
idea (apart from the fact it adds noise to valgrind
reports). In my opinion, GetAddressFromName should zero
the relevant fields of the address before starting work.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1530952&group_id=9863




More information about the wx-dev mailing list