Re: [PATCH 08/14] d_path: make prepend_name() boolean

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

 



On Thu, May 20, 2021 at 04:53:38PM +0200, Petr Mladek wrote:

> That said. vsnprintf() returns the number of characters which would
> be generated for the given input. But only the "size" is written.
> This require copying the characters one by one.

Not really - that's more of avoiding trouble if the sucker gets renamed
right under prepend_name().  Note that we have no way to guarantee that
length and string pointer come from the same moment.  This looking for
NUL is about protection againts stepping off the end of allocated object.



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux