freebsd-dev/lib
Richard Yao ab672133a9
Give strlcat() full buffer lengths rather than smaller buffer lengths
strlcat() is supposed to be given the length of the destination buffer,
including the existing contents. Unfortunately, I had been overzealous
when I wrote a51288aabb, since I gave it
the length of the destination buffer, minus the existing contents. This
likely caused a regression on large strings.

On the topic of being overzealous, the use of strlcat() in
dmu_send_estimate_fast() was unnecessary because recv_clone_name is a
fixed length string. We continue using strlcat() mostly as defensive
programming, in case the string length is ever changed, even though it
is unnecessary.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14476
2023-02-14 11:03:42 -08:00
..
libavl cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libefi Fix multiplication converted to larger type 2022-10-28 09:30:37 -07:00
libicp Unify Assembler files between Linux and Windows 2023-01-17 11:09:19 -08:00
libnvpair Fix GCC 12 compilation errors 2022-11-30 13:45:53 -08:00
libshare Give strlcat() full buffer lengths rather than smaller buffer lengths 2023-02-14 11:03:42 -08:00
libspl Restore FreeBSD to use .rodata 2023-02-06 09:34:59 -08:00
libtpool Add <limits.h> header 2022-11-28 13:24:17 -08:00
libunicode cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libuutil libuutil: deobfuscate internal pointers 2022-11-03 09:57:05 -07:00
libzfs Give strlcat() full buffer lengths rather than smaller buffer lengths 2023-02-14 11:03:42 -08:00
libzfs_core Don't leak packed recieved proprties 2022-11-29 09:51:35 -08:00
libzfsbootenv Fix unchecked return values and unused return values 2022-09-23 16:52:03 -07:00
libzpool libzpool: fix ddi_strtoull to update nptr 2023-01-09 12:49:35 -08:00
libzstd cppcheck: explicitly exclude kernel code from userspace checks 2022-05-10 10:20:55 -07:00
libzutil Use setproctitle to report progress of zfs send 2023-01-17 10:17:35 -08:00
Makefile.am autoconf: use include directives instead of recursing down lib 2022-05-10 10:18:11 -07:00