ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit dfc2f7edac556f9b4e95ba016a6011fff33b2d30
parent acdac112852f822fed95fd6da7f0d3b80fa81af0
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun,  6 Apr 2014 13:23:38 +0200

rmmod: fix segfault if '.' is not found

Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>

Diffstat:
Mrmmod.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rmmod.c b/rmmod.c @@ -38,7 +38,7 @@ main(int argc, char *argv[]) for (i = 0; i < argc; i++) { mod = argv[i]; p = strrchr(mod, '.'); - if (strlen(p) == 3 && !strcmp(p, ".ko")) + if (p && !strcmp(p, ".ko")) *p = '\0'; if (syscall(__NR_delete_module, mod, flags) < 0) eprintf("delete_module:");