Re: Double free error using sprintf in threaded app
Re: Double free error using sprintf in threaded app
- Subject: Re: Double free error using sprintf in threaded app
- From: Greg Guerin <email@hidden>
- Date: Wed, 15 Apr 2009 13:39:07 -0700
Rush Manbert wrote:
char port[sizeof("65536")];
sprintf(port, "%d", m_serverPort);
This seems prone to buffer overflow if the value of m_serverPort is
not adequately constrained.
Try the experiment again calling snprintf() instead of sprintf(), and
see if it changes anything.
Googling the keywords 'sprintf thread safe' suggests relying on
sprintf or its relatives to always be thread-safe might be a
portability risk.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden