From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Cc: Andrew Gunnerson <accounts+github@chiller3.com>,
Gao Xiang <xiang@kernel.org>
Subject: [PATCH 2/2] erofs-utils: tar: Fix printing uninitialized memory from xattr value
Date: Wed, 7 Oct 2026 22:49:09 +0200 [thread overview]
Message-ID: <20261007204909.19426-2-xiang@kernel.org> (raw)
In-Reply-To: <20261007204909.19426-1-xiang@kernel.org>
From: Andrew Gunnerson <accounts+github@chiller3.com>
Link: https://github.com/chenxiaolong/erofs-utils/commit/093e9db89dd78c9cbf77aac26370d385c6a55ecd
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
lib/tar.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/tar.c b/lib/tar.c
index f24ad95..560036e 100644
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -416,12 +416,12 @@ int tarerofs_apply_xattrs(struct erofs_inode *inode, struct list_head *xattrs)
continue;
}
item->kv[item->namelen] = '\0';
- erofs_dbg("Recording xattr(%s)=\"%s\" (of %u bytes) to file %s",
- item->kv, v, vsz, inode->i_srcpath);
+ erofs_dbg("Recording xattr(%s)=\"%.*s\" (of %u bytes) to file %s",
+ item->kv, vsz, v, vsz, inode->i_srcpath);
ret = erofs_vfs_setxattr(inode, item->kv, v, vsz);
if (ret == -ENODATA)
- erofs_err("Failed to set xattr(%s)=%s to file %s",
- item->kv, v, inode->i_srcpath);
+ erofs_err("Failed to set xattr(%s)=%.*s to file %s",
+ item->kv, vsz, v, inode->i_srcpath);
else if (ret)
return ret;
}
--
2.50.1 (Apple Git-155)
prev parent reply other threads:[~2026-10-07 20:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 20:49 [PATCH 1/2] erofs-utils: lib: get rid of unused erofs_ftype_to_dtype() Gao Xiang
2026-10-07 20:49 ` Gao Xiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261007204909.19426-2-xiang@kernel.org \
--to=xiang@kernel.org \
--cc=accounts+github@chiller3.com \
--cc=linux-erofs@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox