Re: [PATCH 08/14] d_path: make prepend_name() boolean
From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2021-05-20 19:37:00
Also in:
linux-fsdevel, linux-s390, lkml
From: Al Viro <viro@zeniv.linux.org.uk>
Date: 2021-05-20 19:37:00
Also in:
linux-fsdevel, linux-s390, lkml
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.