From 63da7cf9a1e2f984bb94ceab671bec52919e9878 Mon Sep 17 00:00:00 2001 From: Filipe Correia Date: Tue, 16 May 2017 17:12:25 +0100 Subject: [PATCH] Fix RangeError when decoding base64 --- nodejs/scripts/jsonix.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/scripts/jsonix.js b/nodejs/scripts/jsonix.js index ab2f9d12f..c3ce00a59 100644 --- a/nodejs/scripts/jsonix.js +++ b/nodejs/scripts/jsonix.js @@ -4361,7 +4361,7 @@ Jsonix.Schema.XSD.Base64Binary = Jsonix.Class(Jsonix.Schema.XSD.AnySimpleType, { input = text.replace(/[^A-Za-z0-9\+\/\=]/g, ""); - var length = (input.length / 4) * 3; + var length = Math.floor(input.length / 4 * 3); if (input.charAt(input.length - 1) === "=") { length--; }