From 038719bb26738e09f9a754709c00b34f718d8022 Mon Sep 17 00:00:00 2001 From: gbrochar Date: Wed, 14 Feb 2024 17:18:09 +0100 Subject: [PATCH] fix: malloc size was too small --- rsa/generate_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rsa/generate_keys.c b/rsa/generate_keys.c index e095e37..a20f9a0 100644 --- a/rsa/generate_keys.c +++ b/rsa/generate_keys.c @@ -4,7 +4,7 @@ int *random_bits(int n) { int fd = open("/dev/urandom", O_RDONLY); ft_log(INFO, "fd"); ft_log(INFO, ft_itoa(fd)); - int *random_bits = (int *)malloc(n >> 4); + int *random_bits = (int *)malloc(n >> 3); if (!random_bits) { ft_log(ERROR, "allocation failed on random_bits"); exit(1);