Print the name of the VALUE_PAIR with the inconsistent value pointer
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 7 Apr 2014 08:17:43 +0000 (09:17 +0100)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 7 Apr 2014 08:17:58 +0000 (09:17 +0100)
src/include/libradius.h

index 12581fc..1e1b656 100644 (file)
@@ -124,10 +124,16 @@ do {\
        if (_x->data.ptr) switch (_x->da->type) {\
        case PW_TYPE_OCTETS:\
        case PW_TYPE_TLV:\
-               (void) talloc_get_type_abort(_x->data.ptr, uint8_t);\
+               if (!talloc_get_type(_x->data.ptr, uint8_t)) {\
+                       fr_perror("Type check failed for attribute \"%s\"", _x->da->name);\
+                       (void) talloc_get_type_abort(_x->data.ptr, uint8_t);\
+               }\
                break;\
        case PW_TYPE_STRING:\
-               (void) talloc_get_type_abort(_x->data.ptr, char);\
+               if (!talloc_get_type(_x->data.ptr, char)) {\
+                       fr_perror("Type check failed for attribute \"%s\"", _x->da->name);\
+                       (void) talloc_get_type_abort(_x->data.ptr, char);\
+               }\
                break;\
        default:\
                break;\