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/utils.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/utils.c')
-rw-r--r-- | libmount/src/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c index d4cc0b3ed..63d1079d0 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -839,7 +839,8 @@ char *mnt_get_mountpoint(const char *path) goto err; dir = st.st_dev; if (dir != base) { - *(p - 1) = '/'; + if (p > mnt) + *(p - 1) = '/'; goto done; } base = dir; |