tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Usage of strncpy in the kernel



>> No, that's not all.  It also fills the rest, if any, of the
>> destination space with more NULs.  (This can be useful to, for
>> example, prevent leaking kernel stack trash to userland.)
> Unfortunately modern compilers no longer guarantee this is true.

Any compiler that renders strncpy() (not strlcpy - that was my mistake)
incapable of upholding its interface contract is, IMO, not suitable for
general-purpose use such as building - or working under - NetBSD.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index