Skip to content

Commit 7e7cdee

Browse files
committed
editors/awk.c: use of potentially dangerous function (fix 16)
Alerts: mirror#60 text data bss dec hex filename 1155501 18124 2056 1175681 11f081 busybox 1155838 18124 2056 1176018 11f1d2 busybox Total 16 fixes +337 Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
1 parent 489014c commit 7e7cdee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

editors/awk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2721,6 +2721,7 @@ static NOINLINE var *exec_builtin(node *op, var *res)
27212721
node *an[4];
27222722
var *av[4];
27232723
const char *as[4];
2724+
struct tm tres;
27242725
node *spl;
27252726
uint32_t isr, info;
27262727
int nargs;
@@ -2866,7 +2867,7 @@ static NOINLINE var *exec_builtin(node *op, var *res)
28662867
time(&tt);
28672868
i = strftime(g_buf, MAXVARFMT,
28682869
((nargs > 0) ? as[0] : "%a %b %d %H:%M:%S %Z %Y"),
2869-
localtime(&tt));
2870+
localtime_r(&tt,&tres));
28702871
setvar_sn(res, g_buf, i);
28712872
break;
28722873

0 commit comments

Comments
 (0)