Fix oob write in rahash2

This commit is contained in:
Álvaro Felipe Melchor 2016-03-21 16:16:01 +01:00
parent 498b9d0fc4
commit 146d7b8e25

View File

@ -474,7 +474,7 @@ int main(int argc, char **argv) {
switch (b64mode) {
case 1: // encode
{
char *out = malloc (((hashstr_len + 1) * 4) / 3);
char *out = malloc ((((hashstr_len + 1) * 4) / 3) + 1);
if (out) {
r_base64_encode (out, (const ut8*)hashstr, hashstr_len);
printf ("%s\n", out);