• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Double free error using sprintf in threaded app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double free error using sprintf in threaded app


  • Subject: Re: Double free error using sprintf in threaded app
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 15 Apr 2009 19:27:01 -0400
  • Organization: Rogue Research Inc.

On 4/15/09 12:43 PM, Rush Manbert said:

>   void operator() (void)
>   {
>     for (size_t loopCount = 0; loopCount < m_loopCount; ++loopCount)
>     {
>       // Do the same thing the socket open code does
>       char port[sizeof("65536")];
>       sprintf(port, "%d", m_serverPort);
>
>       char buf0[512];
>       sprintf (buf0, "%s %d", "Our lop cont is: " , loopCount);
>
>       char buf1[793];
>       sprintf (buf1, "Now the loop count is: %d", loopCount);
>     }
>   }

Some general suggestions:

- try GuardMalloc
- add -fstack-protector -D_FORTIFY_SOURCE=2
- never use sprintf, use snprintf instead

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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

  • Follow-Ups:
    • Re: Double free error using sprintf in threaded app
      • From: "Jeremy W. Sherman" <email@hidden>
References: 
 >Double free error using sprintf in threaded app (From: Rush Manbert <email@hidden>)

  • Prev by Date: Re: Double free error using sprintf in threaded app
  • Next by Date: Re: Double free error using sprintf in threaded app
  • Previous by thread: Double free error using sprintf in threaded app
  • Next by thread: Re: Double free error using sprintf in threaded app
  • Index(es):
    • Date
    • Thread