seccomp_unotify.2: EXAMPLE: correct the check for NUL in buffer returned by read()
commit166126484174024b892563201c08b3be765727dd
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 24 Oct 2020 08:46:28 +0000 (24 10:46 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Wed, 9 Jun 2021 22:40:17 +0000 (10 10:40 +1200)
tree44775fd03a9fa5643da897672e44a68a21c5c1e0
parentd1774d6af831966e45a1c69b895f6d143c98e845
seccomp_unotify.2: EXAMPLE: correct the check for NUL in buffer returned by read()

In the usual case, read(fd, buf, PATH_MAX) will return PATH_MAX
bytes that include trailing garbage after the pathname. So the
right check is to scan from the start of the buffer to see if
there's a NUL, and error if there is not.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man2/seccomp_unotify.2