Bug #3756
closedStack overflow in base64_decode()
100%
Description
Issue raised by user 2018-02-05 via email: stack overflow inside base64_decode() function, when a large data file is supplied.
One step of the work around produced for Bug #3163 uses the internal SaxonJS.U.Atomic.base64Binary.fromString() function to decode a base-64 encoded version of an SEF. SaxonJS.U.Atomic.base64Binary.fromString() calls base64_decode(). The function is used to decode a string of data which has been encoded using base-64 encoding. The output data is represented as a string containing octets/codepoints in the range 0-255.
The user suggested using the native JavaScript base64 decode function atob() rather than our custom version base64_decode(). But the custom version is used because there is an edge-case XPath conformance issue with using atob(), because it is more forgiving of invalid input than the XPath/XSD specification. (Also issues were caused by the non-ASCII character used for the SEF checksum.)
It is suspected that the stack overflow is caused by the large regex at the start of the base64_decode() function.
Please register to edit this issue
Also available in: Atom PDF Tracking page