tech-kern archive

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

Re: Usage of strncpy in the kernel



> All strlcpy() does extra is guarantee NUL-termination,

Extra?  Over strcpy and strncpy?

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.)

/~\ 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