summaryrefslogtreecommitdiffstats
path: root/usr.sbin/extattr
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-01-21 03:49:18 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-01-21 03:49:18 +0000
commitb1a6e45406add6a0bbc1f7275bf3a065a5315a7f (patch)
tree39439fedba80c187b720cc859f1ae79d57b91d46 /usr.sbin/extattr
parent92755e4d60b98447fbb74284fad12d6edbf24108 (diff)
downloadFreeBSD-src-b1a6e45406add6a0bbc1f7275bf3a065a5315a7f.zip
FreeBSD-src-b1a6e45406add6a0bbc1f7275bf3a065a5315a7f.tar.gz
Fix a bug when printing attributes from multiple files: buflen could be
longer than the length of the current attribute if the buffer were reused and previously longer, so bits of the previous, longer attribute would be written. Fix this by using the actual attribute length.
Diffstat (limited to 'usr.sbin/extattr')
-rw-r--r--usr.sbin/extattr/rmextattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/extattr/rmextattr.c b/usr.sbin/extattr/rmextattr.c
index 2b2689b..7ed92b6 100644
--- a/usr.sbin/extattr/rmextattr.c
+++ b/usr.sbin/extattr/rmextattr.c
@@ -269,7 +269,7 @@ main(int argc, char *argv[])
printf("\n");
continue;
} else {
- fwrite(buf, buflen, 1, stdout);
+ fwrite(buf, error, 1, stdout);
printf("\n");
continue;
}
OpenPOWER on IntegriCloud