]> git.ipfire.org Git - thirdparty/man-pages.git/commit
seccomp_user_notif.2: EXAMPLE: correct the check for NUL in buffer returned by read()
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sat, 24 Oct 2020 08:46:28 +0000 (10:46 +0200)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 25 Oct 2020 21:08:30 +0000 (22:08 +0100)
commit2be37e65b3e5032d266f079e02817f64179ac098
treea928fea068c0a7038731d5a99ea9da7bbfe67226
parentb8564f4c516dd8f486d50150cad84cc378d8e77c
seccomp_user_notif.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_user_notif.2