From: Arran Cudbard-Bell Date: Thu, 17 Nov 2016 17:49:00 +0000 (-0500) Subject: Don't copy the entire datum union X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d861005ca796b4d570485464b552e58ec75b399;p=thirdparty%2Ffreeradius-server.git Don't copy the entire datum union --- diff --git a/src/lib/value.c b/src/lib/value.c index 1b3901f61aa..263b8d4d413 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -1702,7 +1702,9 @@ int value_box_copy(TALLOC_CTX *ctx, value_box_t *dst, PW_TYPE src_type, const va { switch (src_type) { default: - memcpy(&dst->datum, &src->datum, value_box_field_sizes[src_type]); + memcpy(((uint8_t *)dst) + value_box_offsets[src_type], + ((uint8_t const *)src) + value_box_offsets[src_type], + value_box_field_sizes[src_type]); break; case PW_TYPE_STRING: