Subject: Re: minor tweak to kern_kthread.c
From: Guenther Grau <Guenther.Grau@bk.bosch.de>
Date: 04/09/1999 11:35:37
"Erik E. Fair" wrote:
> For the case named in the file in the subject, there were pointers to
> objects of indeterminate size, which vsnprintf will limit copying from by
> the limit specified in the API, but ...
Oops, I answered to the wrong mail, then :-( Gordon just posted two
concerning the use of string functions. I thought you were talking about
the first one, where he replaced a memcpy by a strncpy.
I usually hate it when people quote too much, but in this case a little
quote with the lines of the code you were talking about would have
prevented me from making this mistake (but this is of course no excuse
for my mistake :-)
> A check of the vsnprintf API guarantees that the result will always be null
> terminated; I was remembering the pitfall with strncpy(3) which does not
> make such a guarantee. RTFM!
I _did_ look at the man page of strncpy before posting just to make
sure that I remembered this correctly!