diff options
Diffstat (limited to 'src/lib/libcrypto/srp')
-rw-r--r-- | src/lib/libcrypto/srp/srp_lib.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/srp/srp_vfy.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/srp/srp_lib.c b/src/lib/libcrypto/srp/srp_lib.c index a3a67eda2e..77e2c2c2f2 100644 --- a/src/lib/libcrypto/srp/srp_lib.c +++ b/src/lib/libcrypto/srp/srp_lib.c | |||
@@ -121,7 +121,7 @@ BIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N) | |||
121 | 121 | ||
122 | longN= BN_num_bytes(N); | 122 | longN= BN_num_bytes(N); |
123 | 123 | ||
124 | if ((cAB = malloc(2*longN)) == NULL) | 124 | if ((cAB = reallocarray(NULL, 2, longN)) == NULL) |
125 | return NULL; | 125 | return NULL; |
126 | 126 | ||
127 | memset(cAB, 0, longN); | 127 | memset(cAB, 0, longN); |
diff --git a/src/lib/libcrypto/srp/srp_vfy.c b/src/lib/libcrypto/srp/srp_vfy.c index de7dbe5bbd..6ad80ef992 100644 --- a/src/lib/libcrypto/srp/srp_vfy.c +++ b/src/lib/libcrypto/srp/srp_vfy.c | |||
@@ -573,7 +573,7 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, | |||
573 | if(!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) goto err; | 573 | if(!SRP_create_verifier_BN(user, pass, &s, &v, N_bn, g_bn)) goto err; |
574 | 574 | ||
575 | BN_bn2bin(v,tmp); | 575 | BN_bn2bin(v,tmp); |
576 | if (((vf = malloc(BN_num_bytes(v)*2)) == NULL)) | 576 | if (((vf = reallocarray(NULL, BN_num_bytes(v), 2)) == NULL)) |
577 | goto err; | 577 | goto err; |
578 | t_tob64(vf, tmp, BN_num_bytes(v)); | 578 | t_tob64(vf, tmp, BN_num_bytes(v)); |
579 | 579 | ||
@@ -582,7 +582,7 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, | |||
582 | { | 582 | { |
583 | char *tmp_salt; | 583 | char *tmp_salt; |
584 | 584 | ||
585 | if ((tmp_salt = malloc(SRP_RANDOM_SALT_LEN * 2)) == NULL) | 585 | if ((tmp_salt = reallocarray(NULL, SRP_RANDOM_SALT_LEN, 2)) == NULL) |
586 | { | 586 | { |
587 | free(vf); | 587 | free(vf); |
588 | goto err; | 588 | goto err; |