summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
authorKarel Zak2012-06-15 12:26:05 +0200
committerKarel Zak2012-06-15 12:26:05 +0200
commit9d670a2ab4b5b6d5a19aa4d392353f64b7218a5b (patch)
treef36547dd53f32a83799e129bdb633ed190beb452 /libmount/src/optstr.c
parentlibmount: fix trivial typos (diff)
downloadkernel-qcow2-util-linux-9d670a2ab4b5b6d5a19aa4d392353f64b7218a5b.tar.gz
kernel-qcow2-util-linux-9d670a2ab4b5b6d5a19aa4d392353f64b7218a5b.tar.xz
kernel-qcow2-util-linux-9d670a2ab4b5b6d5a19aa4d392353f64b7218a5b.zip
libmount: make some string operations more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 2c9dd5eb1..bf9f8b71f 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -738,7 +738,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
/* don't add options which require values (e.g. offset=%d) */
p = strchr(ent->name, '=');
if (p) {
- if (*(p - 1) == '[')
+ if (p > ent->name && *(p - 1) == '[')
p--; /* name[=] */
else
continue; /* name= */