• 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: Funny crash in on Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Funny crash in on Tiger


  • Subject: Re: Funny crash in on Tiger
  • From: James Housley <email@hidden>
  • Date: Mon, 27 Jun 2005 16:23:55 -0400

glenn andreas wrote:

On Jun 27, 2005, at 2:18 PM, James Housley wrote:

    unsigned char out[MD5_DIGEST_LENGTH+1];

    for (x = 0; x < 48; x++) out[x] = '\0';



According to the header in /usr/include/CommonCrypto/CommonDigest.h:

/usr/include/CommonCrypto/CommonDigest.h:#define CC_MD5_DIGEST_LENGTH 16 /* digest length in bytes */
/usr/include/CommonCrypto/CommonDigest.h:#define MD5_DIGEST_LENGTH CC_MD5_DIGEST_LENGTH



So you declare an array with 17 bytes, and then set 48 bytes of it to 0, overwriting parts of your stack.



You are right, that was it. I was initially getting the 48byte text version, but stopped and missed that. I guess the different stack layouts allowed it to pass sometimes.


Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
 X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden      http://www.FreeBSD.org     The Power to Serve
email@hidden  http://www.TheHousleys.net
---------------------------------------------------------------------
Do not meddle in the affairs of dragons, for you are crunchy and taste
    good with ketchup.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Funny crash in on Tiger (From: James Housley <email@hidden>)
 >Re: Funny crash in on Tiger (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: Funny crash in on Tiger
  • Next by Date: Re: How to find the manual (or at least the header)
  • Previous by thread: Re: Funny crash in on Tiger
  • Next by thread: Re: Funny crash in on Tiger
  • Index(es):
    • Date
    • Thread