diff mbox series

[1/2] libkmod: fix an overflow with wrong modules.builtin.modinfo

Message ID 20210413112315.18907-2-sw0312.kim@samsung.com (mailing list archive)
State New
Headers show
Series harden libkmod-builtin with wrong modules.builtin.modinfo | expand

Commit Message

Seung-Woo Kim April 13, 2021, 11:23 a.m. UTC
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 mbox series

Patch

diff --git a/libkmod/libkmod-builtin.c b/libkmod/libkmod-builtin.c
index fc9a37644261..a75a542f6942 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;
 	}