From a8301640c2ecbea8ab638ed9af414e07cdac88e0 Mon Sep 17 00:00:00 2001 From: Patrick Soquet Date: Mon, 20 Sep 2021 14:43:54 +0200 Subject: [PATCH] xsnap: lockdown, harden, purify --- xs/sources/xsSnapshot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xs/sources/xsSnapshot.c b/xs/sources/xsSnapshot.c index e5519e85e3..90bbe9fc17 100644 --- a/xs/sources/xsSnapshot.c +++ b/xs/sources/xsSnapshot.c @@ -57,7 +57,7 @@ static void fxWriteStack(txMachine* the, txSnapshot* snapshot); #define mxAssert(_ASSERTION,...) { if (!(_ASSERTION)) { fxReport(the, __VA_ARGS__); snapshot->error = C_EINVAL; fxJump(the); } } #define mxThrowIf(_ERROR) { if (_ERROR) { snapshot->error = _ERROR; fxJump(the); } } -#define mxCallbacksLength 474 +#define mxCallbacksLength 477 static txCallback gxCallbacks[mxCallbacksLength] = { fx_AggregateError, fx_Array_from, @@ -166,6 +166,7 @@ static txCallback gxCallbacks[mxCallbacksLength] = { fx_DataView_prototype_setUint32, fx_DataView, fx_Date_now, + fx_Date_now_secure, fx_Date_parse, fx_Date_prototype_getDate, fx_Date_prototype_getDay, @@ -211,6 +212,7 @@ static txCallback gxCallbacks[mxCallbacksLength] = { fx_Date_prototype_valueOf, fx_Date_UTC, fx_Date, + fx_Date_secure, fx_decodeURI, fx_decodeURIComponent, fx_encodeURI, @@ -289,6 +291,7 @@ static txCallback gxCallbacks[mxCallbacksLength] = { fx_Math_mod, fx_Math_pow, fx_Math_random, + fx_Math_random_secure, fx_Math_round, fx_Math_sign, fx_Math_sin,