about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-08-08 16:57:51 +0200
committerLeah Neukirchen <leah@vuxu.org>2018-08-08 16:57:51 +0200
commita4bca521ea329a4f0fff506e880b3ae6a18f9180 (patch)
treeba54b8f99dfaa7685613c61f1940135d8c1ee555
parent1bb1b7e42c22f8946f70a39a81f05ba5ba745e22 (diff)
downloadlr-a4bca521ea329a4f0fff506e880b3ae6a18f9180.tar.gz
lr-a4bca521ea329a4f0fff506e880b3ae6a18f9180.tar.xz
lr-a4bca521ea329a4f0fff506e880b3ae6a18f9180.zip
callback: ensure trailing nul byte
-rw-r--r--lr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index 636b768..7f3d8aa 100644
--- a/lr.c
+++ b/lr.c
@@ -2144,7 +2144,7 @@ callback(const char *fpath, const struct stat *sb, int depth, ino_t entries, off
 	}
 
 	if (need_xattr) {
-		strncpy(fi->xattr, xattr_string(fi->fpath), sizeof fi->xattr);
+		strncpy(fi->xattr, xattr_string(fi->fpath), sizeof fi->xattr - 1);
 		if (strlen(fi->xattr) > maxxattr)
 			maxxattr = strlen(fi->xattr);
 	} else