|
|
99be8f |
From dfc6dc25fcc666ed3fa938bca5ccd87d6cf4a99e Mon Sep 17 00:00:00 2001
|
|
|
99be8f |
From: Andrea Claudi <aclaudi@redhat.com>
|
|
|
99be8f |
Date: Mon, 29 Apr 2019 20:08:08 +0200
|
|
|
99be8f |
Subject: [PATCH] lib/fs: Fix format string in find_fs_mount()
|
|
|
99be8f |
|
|
|
99be8f |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465646
|
|
|
99be8f |
Upstream Status: iproute2.git commit eab450789829e
|
|
|
99be8f |
|
|
|
99be8f |
commit eab450789829e33a64dbd08dced3438d580d5179
|
|
|
99be8f |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
99be8f |
Date: Thu Aug 24 11:51:46 2017 +0200
|
|
|
99be8f |
|
|
|
99be8f |
lib/fs: Fix format string in find_fs_mount()
|
|
|
99be8f |
|
|
|
99be8f |
A field width of 4096 allows fscanf() to store that amount of characters
|
|
|
99be8f |
into the given buffer, though that doesn't include the terminating NULL
|
|
|
99be8f |
byte. Decrease the value by one to leave space for it.
|
|
|
99be8f |
|
|
|
99be8f |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
99be8f |
---
|
|
|
99be8f |
lib/fs.c | 2 +-
|
|
|
99be8f |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
99be8f |
|
|
|
99be8f |
diff --git a/lib/fs.c b/lib/fs.c
|
|
|
99be8f |
index c59ac564581d0..1ff881ecfcd8c 100644
|
|
|
99be8f |
--- a/lib/fs.c
|
|
|
99be8f |
+++ b/lib/fs.c
|
|
|
99be8f |
@@ -45,7 +45,7 @@ static char *find_fs_mount(const char *fs_to_find)
|
|
|
99be8f |
return NULL;
|
|
|
99be8f |
}
|
|
|
99be8f |
|
|
|
99be8f |
- while (fscanf(fp, "%*s %4096s %127s %*s %*d %*d\n",
|
|
|
99be8f |
+ while (fscanf(fp, "%*s %4095s %127s %*s %*d %*d\n",
|
|
|
99be8f |
path, fstype) == 2) {
|
|
|
99be8f |
if (strcmp(fstype, fs_to_find) == 0) {
|
|
|
99be8f |
mnt = strdup(path);
|
|
|
99be8f |
--
|
|
|
99be8f |
2.20.1
|
|
|
99be8f |
|