]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pass in _vpt
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 19 Jul 2019 23:53:06 +0000 (08:53 +0900)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 20 Jul 2019 01:19:55 +0000 (10:19 +0900)
src/lib/server/tmpl.c

index 7c314ddbb94447efb5720ef9a41a843a58e99564..bc20cf127410bfdadc020a3eea6fa6084844e9bd 100644 (file)
@@ -2566,7 +2566,7 @@ static uint8_t const *not_zeroed(uint8_t const *ptr, size_t len)
 
        return NULL;
 }
-#define CHECK_ZEROED(_x) not_zeroed(((uint8_t const *)&vpt->data) + sizeof(_x), sizeof(vpt->data) - sizeof(_x))
+#define CHECK_ZEROED(_vpt, _x) not_zeroed(((uint8_t const *)&(_vpt)->data) + sizeof(_x), sizeof((_vpt)->data) - sizeof(_x))
 
 /** Verify fields of a vp_tmpl_t make sense
  *
@@ -2645,7 +2645,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                break;
 
        case TMPL_TYPE_XLAT_STRUCT:
-               if (CHECK_ZEROED(vpt->data.xlat)) {
+               if (CHECK_ZEROED(vpt, vpt->data.xlat)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_XLAT_STRUCT "
                                     "has non-zero bytes after the data.xlat pointer in the union", file, line);
                        if (!fr_cond_assert(0)) fr_exit_now(1);
@@ -2666,7 +2666,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                break;
 
        case TMPL_TYPE_ATTR:
-               if (CHECK_ZEROED(vpt->data.attribute)) {
+               if (CHECK_ZEROED(vpt, vpt->data.attribute)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_ATTR "
                                     "has non-zero bytes after the data.attribute struct in the union",
                                     file, line);
@@ -2759,7 +2759,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                break;
 
        case TMPL_TYPE_LIST:
-               if (CHECK_ZEROED(vpt->data.attribute)) {
+               if (CHECK_ZEROED(vpt, vpt->data.attribute)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_LIST"
                                     "has non-zero bytes after the data.attribute struct in the union", file, line);
                        if (!fr_cond_assert(0)) fr_exit_now(1);
@@ -2773,7 +2773,7 @@ void tmpl_verify(char const *file, int line, vp_tmpl_t const *vpt)
                break;
 
        case TMPL_TYPE_DATA:
-               if (CHECK_ZEROED(vpt->data.literal)) {
+               if (CHECK_ZEROED(vpt, vpt->data.literal)) {
                        FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_DATA "
                                     "has non-zero bytes after the data.literal struct in the union",
                                     file, line);