From deccdf0e17871b1f5206e5b5c97c8ce192c31e2f Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Thu, 21 Jan 2010 03:49:18 +0000 Subject: [PATCH] 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. --- usr.sbin/extattr/rmextattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/extattr/rmextattr.c b/usr.sbin/extattr/rmextattr.c index 2b2689b0d1f..7ed92b6e965 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; }