Fix spurious soft asserts Fixes #706
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Jun 2014 10:56:51 +0000 (11:56 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 25 Jun 2014 10:59:23 +0000 (11:59 +0100)
src/lib/valuepair.c

index 6ecd30f..93ba8f8 100644 (file)
@@ -232,6 +232,9 @@ VALUE_PAIR *pairfind(VALUE_PAIR *vp, unsigned int attr, unsigned int vendor, int
        vp_cursor_t     cursor;
        VALUE_PAIR      *i;
 
+       /* List head may be NULL if it contains no VPs */
+       if (!vp) return NULL;
+
        VERIFY_LIST(vp);
 
        for (i = fr_cursor_init(&cursor, &vp);