summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/lhash/lhash.c6
-rw-r--r--src/lib/libssl/src/crypto/lhash/lhash.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c
index 1e3359cfe0..932391fa1e 100644
--- a/src/lib/libcrypto/lhash/lhash.c
+++ b/src/lib/libcrypto/lhash/lhash.c
@@ -337,8 +337,7 @@ expand(_LHASH *lh)
337 337
338 if ((lh->p) >= lh->pmax) { 338 if ((lh->p) >= lh->pmax) {
339 j = (int)lh->num_alloc_nodes * 2; 339 j = (int)lh->num_alloc_nodes * 2;
340 n = (LHASH_NODE **)realloc(lh->b, 340 n = reallocarray(lh->b, j, sizeof(LHASH_NODE *));
341 (int)(sizeof(LHASH_NODE *) * j));
342 if (n == NULL) { 341 if (n == NULL) {
343/* fputs("realloc error in lhash", stderr); */ 342/* fputs("realloc error in lhash", stderr); */
344 lh->error++; 343 lh->error++;
@@ -364,8 +363,7 @@ contract(_LHASH *lh)
364 np = lh->b[lh->p + lh->pmax - 1]; 363 np = lh->b[lh->p + lh->pmax - 1];
365 lh->b[lh->p+lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */ 364 lh->b[lh->p+lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
366 if (lh->p == 0) { 365 if (lh->p == 0) {
367 n = (LHASH_NODE **)realloc(lh->b, 366 n = reallocarray(lh->b, lh->pmax, sizeof(LHASH_NODE *));
368 (unsigned int)(sizeof(LHASH_NODE *) * lh->pmax));
369 if (n == NULL) { 367 if (n == NULL) {
370/* fputs("realloc error in lhash", stderr); */ 368/* fputs("realloc error in lhash", stderr); */
371 lh->error++; 369 lh->error++;
diff --git a/src/lib/libssl/src/crypto/lhash/lhash.c b/src/lib/libssl/src/crypto/lhash/lhash.c
index 1e3359cfe0..932391fa1e 100644
--- a/src/lib/libssl/src/crypto/lhash/lhash.c
+++ b/src/lib/libssl/src/crypto/lhash/lhash.c
@@ -337,8 +337,7 @@ expand(_LHASH *lh)
337 337
338 if ((lh->p) >= lh->pmax) { 338 if ((lh->p) >= lh->pmax) {
339 j = (int)lh->num_alloc_nodes * 2; 339 j = (int)lh->num_alloc_nodes * 2;
340 n = (LHASH_NODE **)realloc(lh->b, 340 n = reallocarray(lh->b, j, sizeof(LHASH_NODE *));
341 (int)(sizeof(LHASH_NODE *) * j));
342 if (n == NULL) { 341 if (n == NULL) {
343/* fputs("realloc error in lhash", stderr); */ 342/* fputs("realloc error in lhash", stderr); */
344 lh->error++; 343 lh->error++;
@@ -364,8 +363,7 @@ contract(_LHASH *lh)
364 np = lh->b[lh->p + lh->pmax - 1]; 363 np = lh->b[lh->p + lh->pmax - 1];
365 lh->b[lh->p+lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */ 364 lh->b[lh->p+lh->pmax - 1] = NULL; /* 24/07-92 - eay - weird but :-( */
366 if (lh->p == 0) { 365 if (lh->p == 0) {
367 n = (LHASH_NODE **)realloc(lh->b, 366 n = reallocarray(lh->b, lh->pmax, sizeof(LHASH_NODE *));
368 (unsigned int)(sizeof(LHASH_NODE *) * lh->pmax));
369 if (n == NULL) { 367 if (n == NULL) {
370/* fputs("realloc error in lhash", stderr); */ 368/* fputs("realloc error in lhash", stderr); */
371 lh->error++; 369 lh->error++;