From 6192674bed14c2f3aa307b8761377f322dc76c29 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 13 Apr 2021 20:23:14 +0900 Subject: 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: cherry-pick mainline commit 1cab02ecf6ee] Change-Id: I609585cc97d8abb30541b37d3dee0eda66029162 --- libkmod/libkmod-builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libkmod') 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; } -- cgit v1.2.3