The binLen values are needed to calcualte correct size after conversion.
the hexEnd and b64End values are used by libsodium to store pointers to the next byte after the last parsed byte. Since it was previously just a byte parameter, libsodium would treat it as a address and try to write to that adrress causing JVM to crash
...
siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000007700000000
Register to memory mapping:
RAX=0x0 is NULL
RBX=0x00007fec0817973e points into unknown readable memory: 00 00
...
Also added tests to cover base64 and hex use cases.
Libsodium hex2bin and base642bin expect a pointer to binLen and hexEnd/b64End parameters. Links to libsodium source:
The binLen values are needed to calcualte correct size after conversion.
the hexEnd and b64End values are used by libsodium to store pointers to the next byte after the last parsed byte. Since it was previously just a byte parameter, libsodium would treat it as a address and try to write to that adrress causing JVM to crash
Also added tests to cover base64 and hex use cases.
This fixes #83