Dereferencing NULL is bad
authorAlan T. DeKok <aland@freeradius.org>
Mon, 17 Nov 2014 20:35:18 +0000 (15:35 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 17 Nov 2014 20:35:18 +0000 (15:35 -0500)
src/lib/pair.c

index 998dc22..9c3fdea 100644 (file)
@@ -1857,6 +1857,8 @@ int paircmp(VALUE_PAIR *a, VALUE_PAIR *b)
 #ifndef WITH_REGEX
                return -1;
 #else
+               if (!b) return false;
+
                {
                        int compare;
                        regex_t reg;
@@ -1893,6 +1895,7 @@ int paircmp(VALUE_PAIR *a, VALUE_PAIR *b)
 #endif
 
        default:                /* we're OK */
+               if (!b) return false;
                break;
        }