From: Nick Porter Date: Thu, 24 Jul 2025 13:37:52 +0000 (+0100) Subject: Don't dereference output pointer in debug X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=279d037654146f51200e79739e7d48ce8db2ef58;p=thirdparty%2Ffreeradius-server.git Don't dereference output pointer in debug If `out` points to an integer rather than a char* then dereferencing does not give another pointer. --- diff --git a/src/lib/server/tmpl_eval.c b/src/lib/server/tmpl_eval.c index 79d4e5c5f3..cdaab117cb 100644 --- a/src/lib/server/tmpl_eval.c +++ b/src/lib/server/tmpl_eval.c @@ -606,7 +606,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out, * Cast the data to the correct type. Which also allocates any variable sized buffers from the * output ctx. */ - if (dst_type != vb_in->type) { + if (dst_type != vb_in->type) { if (vb_in == &value) { fr_assert(tmp_ctx != NULL); fr_assert(str != NULL); @@ -650,7 +650,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out, } /* else the output type is a leaf, and is the same data type as the input */ RDEBUG4("Copying %zu bytes to %p from offset %zu", - fr_value_box_field_sizes[dst_type], *((void **)out), fr_value_box_offsets[dst_type]); + fr_value_box_field_sizes[dst_type], out, fr_value_box_offsets[dst_type]); fr_value_box_memcpy_out(out, vb_in);