FreeBSD Bugzilla – Attachment 185810 Details for
Bug 221854
makefs: Reject UFS labels that are too long to fit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
makefs: Reject UFS labels that are too long to fit
makefs-Reject-UFS-labels-that-are-too-long-to-fit.diff (text/plain), 1006 bytes, created by
Fabian Keil
on 2017-08-27 10:49:53 UTC
(
hide
)
Description:
makefs: Reject UFS labels that are too long to fit
Filename:
MIME Type:
Creator:
Fabian Keil
Created:
2017-08-27 10:49:53 UTC
Size:
1006 bytes
patch
obsolete
>From 684dc2d013dc8dee926aafb37e7718afbf1976af Mon Sep 17 00:00:00 2001 >From: Fabian Keil <fk@fabiankeil.de> >Date: Sun, 21 May 2017 09:59:27 +0200 >Subject: [PATCH] makefs: Reject UFS labels that are too long to fit > >Previously they were silently truncated. > >Obtained from: ElectroBSD >--- > usr.sbin/makefs/ffs.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c >index 3457327045a4..3162fe046996 100644 >--- a/usr.sbin/makefs/ffs.c >+++ b/usr.sbin/makefs/ffs.c >@@ -237,7 +237,11 @@ ffs_parse_opts(const char *option, fsinfo_t *fsopts) > } > rv = 1; > } else if (strcmp(var, "label") == 0) { >- strlcpy(ffs_opts->label, val, sizeof(ffs_opts->label)); >+ if (strlcpy(ffs_opts->label, val, sizeof(ffs_opts->label)) >= >+ sizeof(ffs_opts->label)) { >+ errx(1, "Label `%s' does not fit. Max label length is %d.", >+ val, (int)sizeof(ffs_opts->label) - 1); >+ } > rv = 1; > } else > rv = set_option(ffs_options, var, val); >-- >2.14.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 221854
: 185810