diff options
author | Karel Zak | 2012-06-15 12:26:05 +0200 |
---|---|---|
committer | Karel Zak | 2012-06-15 12:26:05 +0200 |
commit | 9d670a2ab4b5b6d5a19aa4d392353f64b7218a5b (patch) | |
tree | f36547dd53f32a83799e129bdb633ed190beb452 /libmount/src/optstr.c | |
parent | libmount: fix trivial typos (diff) | |
download | kernel-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.c | 2 |
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= */ |