30 lines
845 B
Diff
30 lines
845 B
Diff
|
From 1cab02ecf6ee2a0aa34f3615dfd99c59f7e04e90 Mon Sep 17 00:00:00 2001
|
||
|
From: Seung-Woo Kim <sw0312.kim@samsung.com>
|
||
|
Date: Tue, 13 Apr 2021 20:23:14 +0900
|
||
|
Subject: [PATCH] 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>
|
||
|
---
|
||
|
libkmod/libkmod-builtin.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
--
|
||
|
2.13.6
|
||
|
|