]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
request may be NULL
authorAlan T. DeKok <aland@freeradius.org>
Mon, 10 Aug 2009 17:14:39 +0000 (19:14 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 10 Aug 2009 17:14:39 +0000 (19:14 +0200)
src/modules/rlm_expr/paircmp.c

index 944a62bc9a38eae55bf7102cabcfa4a518cb757e..fee7525886eb2fe066be2fbb65a4c642e2b05572 100644 (file)
@@ -58,12 +58,16 @@ static int portcmp(void *instance,
        char buf[MAX_STRING_LEN];
        char *s, *p, *next;
        uint32_t lo, hi;
-       uint32_t port = request->vp_integer;
+       uint32_t port;
 
        instance = instance;
        check_pairs = check_pairs; /* shut the compiler up */
        reply_pairs = reply_pairs;
 
+       if (!request) return -1;
+
+       port = request->vp_integer;
+
        if ((strchr((char *)check->vp_strvalue, ',') == NULL) &&
                        (strchr((char *)check->vp_strvalue, '-') == NULL)) {
                return (request->vp_integer - check->vp_integer);