nul-terminate readlink() output

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-08-18 11:57:37 -04:00
parent 53e144e93b
commit 459060f763

View File

@ -590,6 +590,8 @@ struct bchfs_handle bchu_fs_open_by_dev(const char *path, int *idx)
if (len <= 0)
goto read_super;
buf[len] = '\0';
fs_str = strstr(buf, "bcachefs/");
if (!fs_str)
die("error parsing sysfs");