From: Matthew Newton Date: Wed, 21 Mar 2018 12:34:51 +0000 (-0500) Subject: Use string not array so we don't expand random junk X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f410ea25e2e679b94a357e6cd77ce07d19a36b2;p=thirdparty%2Ffreeradius-server.git Use string not array so we don't expand random junk --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 5798edd978e..dc51911e411 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -3887,14 +3887,15 @@ char *fr_value_box_asprint(TALLOC_CTX *ctx, fr_value_box_t const *data, char quo case FR_TYPE_DATE: { + char buff[64]; time_t t; struct tm s_tm; t = data->vb_date; - - p = talloc_array(ctx, char, 64); - strftime(p, 64, "%b %e %Y %H:%M:%S %Z", + strftime(buff, 64, "%b %e %Y %H:%M:%S %Z", localtime_r(&t, &s_tm)); + + p = talloc_typed_strdup(ctx, buff); break; }