aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2024-07-10 07:04:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2024-07-10 07:04:28 +0200
commit0a88a7ae3bb350d72712628078cf79517f627e99 (patch)
treee7bbe85983c37d7293cf174e83a9874d9a50f7d4
parent2eea3494f160da7640813bef1e276f806452148f (diff)
downloadbusybox-w32-0a88a7ae3bb350d72712628078cf79517f627e99.tar.gz
busybox-w32-0a88a7ae3bb350d72712628078cf79517f627e99.tar.bz2
busybox-w32-0a88a7ae3bb350d72712628078cf79517f627e99.zip
awk: mktime() with no arguments is not allowed
It was SEGVing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--editors/awk.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/editors/awk.c b/editors/awk.c
index d4491d3e7..64e752f4b 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -509,7 +509,7 @@ static const uint32_t tokeninfo[] ALIGN4 = {
509 OC_F|F_rn, OC_F|F_si|Nx|Rx, OC_F|F_sq|Nx|Rx, OC_F|F_sr|Nx, // rand sin sqrt srand 509 OC_F|F_rn, OC_F|F_si|Nx|Rx, OC_F|F_sq|Nx|Rx, OC_F|F_sr|Nx, // rand sin sqrt srand
510 OC_B|B_ge|_s_vv_|A3,OC_B|B_gs|ss_vv_|A2,OC_B|B_ix|_ss_vv|A2, // gensub gsub index /*length was here*/ 510 OC_B|B_ge|_s_vv_|A3,OC_B|B_gs|ss_vv_|A2,OC_B|B_ix|_ss_vv|A2, // gensub gsub index /*length was here*/
511 OC_B|B_ma|__s__v|A2,OC_B|B_sp|__s_vv|A2,OC_SPRINTF, OC_B|B_su|ss_vv_|A2,// match split sprintf sub 511 OC_B|B_ma|__s__v|A2,OC_B|B_sp|__s_vv|A2,OC_SPRINTF, OC_B|B_su|ss_vv_|A2,// match split sprintf sub
512 OC_B|B_ss|__svvv|A2,OC_F|F_ti, OC_B|B_ti|__s_vv, OC_B|B_mt|__s_vv, // substr systime strftime mktime 512 OC_B|B_ss|__svvv|A2,OC_F|F_ti, OC_B|B_ti|__s_vv, OC_B|B_mt|__s_vv|A1,// substr systime strftime mktime
513 OC_B|B_lo|__s__v|A1,OC_B|B_up|__s__v|A1, // tolower toupper 513 OC_B|B_lo|__s__v|A1,OC_B|B_up|__s__v|A1, // tolower toupper
514 OC_F|F_le|Sx, // length 514 OC_F|F_le|Sx, // length
515 OC_GETLINE|SV, // getline 515 OC_GETLINE|SV, // getline
@@ -2870,7 +2870,6 @@ static NOINLINE var *exec_builtin(node *op, var *res)
2870 tt = getvar_i(av[1]); 2870 tt = getvar_i(av[1]);
2871 else 2871 else
2872 time(&tt); 2872 time(&tt);
2873 //s = (nargs > 0) ? as[0] : "%a %b %d %H:%M:%S %Z %Y";
2874 i = strftime(g_buf, MAXVARFMT, 2873 i = strftime(g_buf, MAXVARFMT,
2875 ((nargs > 0) ? as[0] : "%a %b %d %H:%M:%S %Z %Y"), 2874 ((nargs > 0) ? as[0] : "%a %b %d %H:%M:%S %Z %Y"),
2876 localtime(&tt)); 2875 localtime(&tt));