commit 8c075e33 introduced a regression. The previous sscanf() implicitly
did a null termination on path, while the new code misses the null
termination. This can result in a failing hugetlbfs_test_path() and an
error message like: "libhugetlbfs: WARNING: Hugepage size 1048576 unavailable"

Signed-off-by: Gerald Schaefer <gerald.schae...@de.ibm.com>
---
 hugeutils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hugeutils.c b/hugeutils.c
index 6a4dc85..53a7fbd 100644
--- a/hugeutils.c
+++ b/hugeutils.c
@@ -665,6 +665,7 @@ static void find_mounts(void)
                                continue;
 
                        strncpy(path, match, end - match);
+                       path[end - match] = '\0';
                        if ((hugetlbfs_test_path(path) == 1) &&
                            !(access(path, R_OK | W_OK | X_OK)))
                                add_hugetlbfs_mount(path, 0);
-- 
1.7.12.4


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Libhugetlbfs-devel mailing list
Libhugetlbfs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel

Reply via email to