summaryrefslogtreecommitdiff
path: root/libkmod
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2021-04-13 20:23:14 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2021-05-20 18:47:19 +0900
commit6192674bed14c2f3aa307b8761377f322dc76c29 (patch)
tree93a541dc2923c5e74d0fdb2e321f5ecd6aa0639f /libkmod
parent4fc543f0c31acb29d9b2f951e79f4c997536b2c5 (diff)
downloadkmod-6192674bed14c2f3aa307b8761377f322dc76c29.tar.gz
kmod-6192674bed14c2f3aa307b8761377f322dc76c29.tar.bz2
kmod-6192674bed14c2f3aa307b8761377f322dc76c29.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> [sw0312.kim: cherry-pick mainline commit 1cab02ecf6ee] Change-Id: I609585cc97d8abb30541b37d3dee0eda66029162
Diffstat (limited to 'libkmod')
-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;
}