file: prevent writes beyond end of uh_buf on enumerating directories
Under some circumstances, e.g. when enumerating the entries of a directory
hierarchy close to 4096 bytes total path length, the sprintf() used to
conatenate the filename might write beyond the end of the PATH_MAX sized
global `uh_buf` scratch buffer used to form the complete file paths during
enumeration, potentially clobbering neighboring data structures, such as
the global configuration struct.
Prevent this issue by passing the amount of remaining available bytes for
the name componentent to the `list_entries()` function and passing this
value to `snprintf()` therein.
Signed-off-by: Jo-Philipp Wich <[email protected]>