Fixed buffer overflow in crypto