findmnt: always allocate memory for cell value
PATCH 1/1 findmnt: always allocate memory for cell value
Since b3386c83fe77, findmnt's output uses TT_FL_FREEDATA, which causes a crash here when string literal is returned instead of a heap address.
Signed-off-by Dave Reisner <[email protected]>
--- misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
misc-utils/findmnt.c +1 -1
@@ -469,7 +469,7 @@ static char *get_vfs_attr(struct libmnt_fs *fs, int sizetype)break ;case COL_USEPERC :if (buf.f_blocks ==0 ) -return "-" ; +return xstrdup ("-" ); xasprintf(&sizestr, "%.0f%%", (double)(buf.f_blocks - buf.f_bfree) /
Signature · 1 line
1.8.4
Quoted 2 lines · Dave Reisner
misc-utils/findmnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com