Secure Coding mailing list archives

RE: New Microsoft Security Tool for developers


From: Örjan Petersson <nospam () logcode com>
Date: Tue, 16 Dec 2003 14:13:46 +0000

I cannot find supporting documentation for the claim "and nullify
the
rest of the buffer of dest". IIRC, strncpy will copy a null byte
from
src to dst, but it does not nullify the rest of dst.

Hey Crispin,

This would be dependant on the implimentation of strncpy. For most
implementations on Unix it will indeed copy null chars in the rest of
the
buffer up the size requested.


The C standard requires this behaviour so implementations that do
not pad the destination string with nul characters are not conformant.
-- 
Örjan Petersson, Logcode SARL
The email address in the From: header is valid










Current thread: