summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2021-04-13 20:23:14 +0900
committerLucas De Marchi <lucas.demarchi@intel.com>2021-04-17 13:41:42 -0700
commit1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90 (patch)
tree74200f4c82e041e62bfbe64a9c4a0680d2e5d64c
parented892ff4edfe99e4ca0aca160e7b875ddefb1ec8 (diff)
downloadkmod-1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90.tar.gz
kmod-1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90.tar.bz2
kmod-1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90.zip
libkmod: fix an overflow with wrong modules.builtin.modinfo
Fix a possbile overflow with exact PATH_MAX length modname in wrong modules.builtin.modinfo. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--libkmod/libkmod-builtin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c
index fc9a376..a75a542 100644
--- a/libkmod/libkmod-builtin.c
+++ b/libkmod/libkmod-builtin.c
@@ -246,7 +246,7 @@ bool kmod_builtin_iter_get_modname(struct kmod_builtin_iter *iter,
len = dot - line;
- if (len > PATH_MAX) {
+ if (len >= PATH_MAX) {
sv_errno = ENAMETOOLONG;
goto fail;
}