]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Allowing copying NULL boxes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 20 Sep 2021 23:02:26 +0000 (18:02 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 20 Sep 2021 23:02:26 +0000 (18:02 -0500)
src/lib/util/value.c

index d5d41377bd20beaba3b321d7190c52de79de7b19..5f2923d298627d862df71db05e768b59c8008fd6 100644 (file)
@@ -3332,8 +3332,6 @@ void fr_value_box_clear(fr_value_box_t *data)
  */
 int fr_value_box_copy(TALLOC_CTX *ctx, fr_value_box_t *dst, const fr_value_box_t *src)
 {
-       if (!fr_cond_assert(src->type != FR_TYPE_NULL)) return -1;
-
        switch (src->type) {
        default:
                memcpy(((uint8_t *)dst) + fr_value_box_offsets[src->type],
@@ -3342,6 +3340,10 @@ int fr_value_box_copy(TALLOC_CTX *ctx, fr_value_box_t *dst, const fr_value_box_t
                fr_value_box_copy_meta(dst, src);
                break;
 
+       case FR_TYPE_NULL:
+               fr_value_box_copy_meta(dst, src);
+               break;
+
        case FR_TYPE_STRING:
        {
                char *str = NULL;