Re: Buffer overflows
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Aug 31, 2007, 10:52 UTC
- Message-ID
- <BD9F3FD0-94EF-4182-A03B-B26B18544894@wincent.com>
- In-Reply-To
- <3f4fd2640708301534k40f07a1cva90a59d12ace6138@mail.gmail.com>
El 31/8/2007, a las 0:34, Reece Dunn escribió:
Show 5 quoted lines
> As an example, do your safe API do null pointer checks. This is > because strcpy, strlen and the like don't, which is one of the reasons > why they are considered unsafe. But then, if you guarantee that you > are not passing a null pointer to one of these API, why take the hit > of the additional checks when you know that these are safe.
Do you really think that comparing a pointer to NULL is going to be a speed hit? I would imagine that on most architectures it boils down to one or two machine code instructions.
Cheers, Wincent