[hackers] [ubase] rmmod: fix segfault if '.' is not found || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Sun, 06 Apr 2014 13:51:36 +0200

commit dfc2f7edac556f9b4e95ba016a6011fff33b2d30
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Sun Apr 6 13:23:38 2014 +0200

    rmmod: fix segfault if '.' is not found
    
    Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>

diff --git a/rmmod.c b/rmmod.c
index 7929006..6e5a3fd 100644
--- a/rmmod.c
+++ b/rmmod.c
_AT_@ -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 = '
Received on Sun Apr 06 2014 - 13:51:36 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 06 2014 - 14:00:32 CEST