]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use string not array so we don't expand random junk
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 21 Mar 2018 12:34:51 +0000 (07:34 -0500)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 21 Mar 2018 12:39:50 +0000 (12:39 +0000)
src/lib/util/value.c

index 5798edd978ecbb25e5081c3e71b5e230ecb5cb2f..dc51911e411dd61191d8623eb39bbb5afe8c729a 100644 (file)
@@ -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;
        }