Skip to content

Commit 4c2e146

Browse files
committed
networking/httpd_indexcgi.c: use of potentially dangerous function (fix 15)
Alerts: mirror#65-64 text data bss dec hex filename 1155501 18124 2056 1175681 11f081 busybox 1155740 18124 2056 1175920 11f170 busybox Total 15 fixes +239 Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
1 parent 1ed77ca commit 4c2e146

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

networking/httpd_indexcgi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
348348
count_files = 0;
349349
size_total = 0;
350350
while (--dir_list_count >= 0) {
351-
struct tm *ptm;
351+
struct tm *ptm, tres;
352352
time_t tt;
353353

354354
cdir = *dir_list++;
@@ -375,10 +375,10 @@ int main(int argc, char **argv)
375375
dst = fmt_ull(dst, cdir->D_SIZE);
376376
dst = fmt_str(dst, "<td class=dt>");
377377
if (sizeof(cdir->D_MTIME) == sizeof(tt))
378-
ptm = gmtime((time_t*)&cdir->D_MTIME);
378+
ptm = gmtime_r((time_t*)&cdir->D_MTIME,&tres);
379379
else {
380380
tt = cdir->D_MTIME;
381-
ptm = gmtime(&tt);
381+
ptm = gmtime_r(&tt,&tres);
382382
}
383383
dst = fmt_04u(dst, 1900 + ptm->tm_year); *dst++ = '-';
384384
dst = fmt_02u(dst, ptm->tm_mon + 1); *dst++ = '-';

0 commit comments

Comments
 (0)