Fix for coverity (may pass NULL char pointer to strstr)
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 02:52:22 +0000 (21:52 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 17 Feb 2013 02:52:22 +0000 (21:52 -0500)
scripts/jlibtool.c

index 6a9f9a2..79463de 100644 (file)
@@ -1311,9 +1311,9 @@ static void add_minus_l(count_chars *cc, const char *arg)
     char *newarg;
     char *name = strrchr(arg, '/');
     char *file = strrchr(arg, '.');
-    char *lib  = strstr(name, "lib");
 
-    if (name !=NULL && file != NULL && lib == name+1) {
+    if ((name != NULL) && (file != NULL) &&
+        (strstr(name, "lib") == (name + 1))) {
         *name = '\0';
         *file = '\0';
         file = name;