From: Edward Shishkin <edward.shishkin@gmail.com>
To: ReiserFS Development mailing list <reiserfs-devel@vger.kernel.org>
Subject: [patch 2/6] reiser4progs: Limit printing of label to the maximum of 16 chars
Date: Fri, 03 May 2013 22:39:06 +0200 [thread overview]
Message-ID: <5184206A.4000100@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: reiser4progs-limit-printing-of-label-to-the-maximum-of-16-chars.patch --]
[-- Type: text/x-patch, Size: 1138 bytes --]
From: Mike Fleetwood <mike.fleetwood@googlemail.com>
For a reiser4 file system with exactly the maximum size 16 character
label, debugfs.reiser4 prints junk from memory at the end of the label.
This is because the label is read into a 16 character array and is
printed as a string, but there isn't a nul terminating character.
# mkfs.reiser4 --yes --label abcdefghij123456 /dev/sda13
# debugfs.reiser4 /dev/sda13 2> /dev/null | grep label:
label: abcdefghij123456!
Print at most 16 characters of the label.
Signed-off-by: Mike Fleetwood <mike.fleetwood@googlemail.com>
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
---
librepair/master.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- reiser4progs-1.0.7.orig/librepair/master.c
+++ reiser4progs-1.0.7/librepair/master.c
@@ -356,7 +356,7 @@ void repair_master_print(reiser4_master_
#endif
if (*master->ent.ms_label != '\0') {
- aal_stream_format(stream, "label:\t\t%s\n",
+ aal_stream_format(stream, "label:\t\t%.16s\n",
reiser4_master_get_label(master));
} else {
aal_stream_format(stream, "label:\t\t<none>\n");
reply other threads:[~2013-05-03 20:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=5184206A.4000100@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=reiserfs-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).