[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox-cvs
Subject:    [git commit] modprobe-small: fix safe_strncpy truncating last char of module name
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2014-05-26 13:01:13
Message-ID: 20140526130144.0DD2C9CDD9 () busybox ! osuosl ! org
[Download RAW message or body]

commit: http://git.busybox.net/busybox/commit/?id=fd0640e5a12f74b7ab1d918cf884df0c59402c5a
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
---
 modutils/modprobe-small.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
index 91e0c13..b7990bf 100644
--- a/modutils/modprobe-small.c
+++ b/modutils/modprobe-small.c
@@ -297,7 +297,7 @@ static int pathname_matches_modname(const char *pathname, const char *modname)
 	char name[MODULE_NAME_LEN];
 	const char *fname = bb_get_last_path_component_nostrip(pathname);
 	const char *suffix = strrstr(fname, ".ko");
-	safe_strncpy(name, fname, suffix - fname);
+	safe_strncpy(name, fname, suffix - fname + 1);
 	replace(name, '-', '_');
 	r = (strcmp(name, modname) == 0);
 	return r;
_______________________________________________
busybox-cvs mailing list
busybox-cvs@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic