From 8225bb78a631d032121f9d7eed19481220933c88 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 30 May 2013 13:29:34 +0200 Subject: libmount: more robust options string parsing # mount -o=rw /dev/sdb /mnt/test mount: libmount/src/optmap.c:212: mnt_optmap_get_entry: Assertion `namelen' failed. Aborted (core dumped) Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=968786 Signed-off-by: Karel Zak --- sys-utils/mount.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys-utils/mount.c') diff --git a/sys-utils/mount.c b/sys-utils/mount.c index 8ff94611c..0998b0110 100644 --- a/sys-utils/mount.c +++ b/sys-utils/mount.c @@ -682,6 +682,8 @@ static void sanitize_paths(struct libmnt_context *cxt) static void append_option(struct libmnt_context *cxt, const char *opt) { + if (opt && (*opt == '=' || *opt == '\'' || *opt == '\"' || isblank(*opt))) + errx(MOUNT_EX_USAGE, _("unsupported option format: %s"), opt); if (mnt_context_append_options(cxt, opt)) err(MOUNT_EX_SYSERR, _("failed to append option '%s'"), opt); } -- cgit v1.2.3-55-g7522