libfuse: null-terminate buffer in fuse_req_getgroups()
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 13 Jun 2024 11:57:25 +0000 (13:57 +0200)
committerBernd Schubert <bernd.schubert@fastmail.fm>
Thu, 13 Jun 2024 14:39:54 +0000 (16:39 +0200)
commit29f621af8d39d5a140da584ff6c1eb00147b5a56
tree7625e541f78edc4ff36decc86a2cbae33ae9476e
parent8bd873cbcc6037655c0a6cf2f63fe1f8f13c5a5e
libfuse: null-terminate buffer in fuse_req_getgroups()

After reading the file /proc/$PID/task/$PID/status the buffer wasn't
terminated with a null character.  This could theoretically lead to buffer
overrun by the subsequent strstr() call.

Since the contents of the proc file are guaranteed to contain the pattern
that strstr is looking for, this doesn't happen in normal situations.

Add null termination for robustness.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
lib/fuse_lowlevel.c