]> git.proxmox.com Git - mirror_zfs.git/commit
FreeBSD: do_mount() passes wrong string length to helper
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Thu, 3 Nov 2022 17:53:17 +0000 (13:53 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 18 Nov 2022 19:34:25 +0000 (11:34 -0800)
commit0a0166c9755a423906c097a29702d4962c73cf77
tree6cd3c5947de7d0204c1211483c25371e19dc74e1
parent31247c78b15aefeac5d395109209ca8a99ff5d60
FreeBSD: do_mount() passes wrong string length to helper

It should pass `MNT_LINE_MAX`, but passes `sizeof (mntpt)`. This is
harmless because the strlen is not actually used by the helper, but
FreeBSD's Coverity scans complained about it.

This was missed in my audit of various string functions since it is not
actually passed to a string function.

Upon review, it was noticed that the helper function does not need to be
a separate function, so I have inlined it as cleanup.

Reported-by: Coverity (CID 1432079)
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: szubersk <szuberskidamian@gmail.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14136
lib/libzfs/os/freebsd/libzfs_zmount.c