diff options
| author | deraadt <> | 2014-05-29 21:19:30 +0000 | 
|---|---|---|
| committer | deraadt <> | 2014-05-29 21:19:30 +0000 | 
| commit | 44c9da02b72b146dbbcafcaec3c3976d04f5c0df (patch) | |
| tree | 956fc9edb289b1e8d01f4d38b053f5348ad99c38 /src/lib/libc | |
| parent | 642d45ae22413aa8195b105d051ca8896e782c5d (diff) | |
| download | openbsd-44c9da02b72b146dbbcafcaec3c3976d04f5c0df.tar.gz openbsd-44c9da02b72b146dbbcafcaec3c3976d04f5c0df.tar.bz2 openbsd-44c9da02b72b146dbbcafcaec3c3976d04f5c0df.zip | |
ok, next pass after review:  when possible, put the reallocarray arguments
in the "size_t nmemb, size_t size"
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/bn/bn_gf2m.c | 10 | ||||
| -rw-r--r-- | src/lib/libcrypto/bn/bn_lib.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/ec/ec_mult.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/lhash/lhash.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/objects/obj_xref.c | 2 | ||||
| -rw-r--r-- | src/lib/libcrypto/txt_db/txt_db.c | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/x509v3/pcy_tree.c | 2 | 
7 files changed, 12 insertions, 12 deletions
| diff --git a/src/lib/libcrypto/bn/bn_gf2m.c b/src/lib/libcrypto/bn/bn_gf2m.c index 4bd50924d3..f451befb0d 100644 --- a/src/lib/libcrypto/bn/bn_gf2m.c +++ b/src/lib/libcrypto/bn/bn_gf2m.c | |||
| @@ -547,7 +547,7 @@ BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p, | |||
| 547 | bn_check_top(a); | 547 | bn_check_top(a); | 
| 548 | bn_check_top(b); | 548 | bn_check_top(b); | 
| 549 | bn_check_top(p); | 549 | bn_check_top(p); | 
| 550 | if ((arr = reallocarray(NULL, sizeof(int), max)) == NULL) | 550 | if ((arr = reallocarray(NULL, max, sizeof(int))) == NULL) | 
| 551 | goto err; | 551 | goto err; | 
| 552 | ret = BN_GF2m_poly2arr(p, arr, max); | 552 | ret = BN_GF2m_poly2arr(p, arr, max); | 
| 553 | if (!ret || ret > max) { | 553 | if (!ret || ret > max) { | 
| @@ -609,7 +609,7 @@ BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
| 609 | 609 | ||
| 610 | bn_check_top(a); | 610 | bn_check_top(a); | 
| 611 | bn_check_top(p); | 611 | bn_check_top(p); | 
| 612 | if ((arr = reallocarray(NULL, sizeof(int), max)) == NULL) | 612 | if ((arr = reallocarray(NULL, max, sizeof(int))) == NULL) | 
| 613 | goto err; | 613 | goto err; | 
| 614 | ret = BN_GF2m_poly2arr(p, arr, max); | 614 | ret = BN_GF2m_poly2arr(p, arr, max); | 
| 615 | if (!ret || ret > max) { | 615 | if (!ret || ret > max) { | 
| @@ -1037,7 +1037,7 @@ BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *p, | |||
| 1037 | bn_check_top(a); | 1037 | bn_check_top(a); | 
| 1038 | bn_check_top(b); | 1038 | bn_check_top(b); | 
| 1039 | bn_check_top(p); | 1039 | bn_check_top(p); | 
| 1040 | if ((arr = reallocarray(NULL, sizeof(int), max)) == NULL) | 1040 | if ((arr = reallocarray(NULL, max, sizeof(int))) == NULL) | 
| 1041 | goto err; | 1041 | goto err; | 
| 1042 | ret = BN_GF2m_poly2arr(p, arr, max); | 1042 | ret = BN_GF2m_poly2arr(p, arr, max); | 
| 1043 | if (!ret || ret > max) { | 1043 | if (!ret || ret > max) { | 
| @@ -1099,7 +1099,7 @@ BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
| 1099 | int *arr = NULL; | 1099 | int *arr = NULL; | 
| 1100 | bn_check_top(a); | 1100 | bn_check_top(a); | 
| 1101 | bn_check_top(p); | 1101 | bn_check_top(p); | 
| 1102 | if ((arr = reallocarray(NULL, sizeof(int), max)) == NULL) | 1102 | if ((arr = reallocarray(NULL, max, sizeof(int))) == NULL) | 
| 1103 | goto err; | 1103 | goto err; | 
| 1104 | ret = BN_GF2m_poly2arr(p, arr, max); | 1104 | ret = BN_GF2m_poly2arr(p, arr, max); | 
| 1105 | if (!ret || ret > max) { | 1105 | if (!ret || ret > max) { | 
| @@ -1234,7 +1234,7 @@ BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) | |||
| 1234 | 1234 | ||
| 1235 | bn_check_top(a); | 1235 | bn_check_top(a); | 
| 1236 | bn_check_top(p); | 1236 | bn_check_top(p); | 
| 1237 | if ((arr = reallocarray(NULL, sizeof(int), max)) == NULL) | 1237 | if ((arr = reallocarray(NULL, max, sizeof(int))) == NULL) | 
| 1238 | goto err; | 1238 | goto err; | 
| 1239 | ret = BN_GF2m_poly2arr(p, arr, max); | 1239 | ret = BN_GF2m_poly2arr(p, arr, max); | 
| 1240 | if (!ret || ret > max) { | 1240 | if (!ret || ret > max) { | 
| diff --git a/src/lib/libcrypto/bn/bn_lib.c b/src/lib/libcrypto/bn/bn_lib.c index 28489f8181..a4f0bdd34b 100644 --- a/src/lib/libcrypto/bn/bn_lib.c +++ b/src/lib/libcrypto/bn/bn_lib.c | |||
| @@ -278,7 +278,7 @@ bn_expand_internal(const BIGNUM *b, int words) | |||
| 278 | BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); | 278 | BN_R_EXPAND_ON_STATIC_BIGNUM_DATA); | 
| 279 | return (NULL); | 279 | return (NULL); | 
| 280 | } | 280 | } | 
| 281 | a = A = reallocarray(NULL, sizeof(BN_ULONG), words); | 281 | a = A = reallocarray(NULL, words, sizeof(BN_ULONG)); | 
| 282 | if (A == NULL) { | 282 | if (A == NULL) { | 
| 283 | BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); | 283 | BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE); | 
| 284 | return (NULL); | 284 | return (NULL); | 
| diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c index b3bd34d82d..0fd0cab2f1 100644 --- a/src/lib/libcrypto/ec/ec_mult.c +++ b/src/lib/libcrypto/ec/ec_mult.c | |||
| @@ -790,7 +790,7 @@ ec_wNAF_precompute_mult(EC_GROUP * group, BN_CTX * ctx) | |||
| 790 | num = pre_points_per_block * numblocks; /* number of points to | 790 | num = pre_points_per_block * numblocks; /* number of points to | 
| 791 | * compute and store */ | 791 | * compute and store */ | 
| 792 | 792 | ||
| 793 | points = reallocarray(NULL, sizeof(EC_POINT *), (num + 1)); | 793 | points = reallocarray(NULL, (num + 1), sizeof(EC_POINT *)); | 
| 794 | if (!points) { | 794 | if (!points) { | 
| 795 | ECerr(EC_F_EC_WNAF_PRECOMPUTE_MULT, ERR_R_MALLOC_FAILURE); | 795 | ECerr(EC_F_EC_WNAF_PRECOMPUTE_MULT, ERR_R_MALLOC_FAILURE); | 
| 796 | goto err; | 796 | goto err; | 
| diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c index e75a43f506..1e3359cfe0 100644 --- a/src/lib/libcrypto/lhash/lhash.c +++ b/src/lib/libcrypto/lhash/lhash.c | |||
| @@ -119,7 +119,7 @@ lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c) | |||
| 119 | 119 | ||
| 120 | if ((ret = malloc(sizeof(_LHASH))) == NULL) | 120 | if ((ret = malloc(sizeof(_LHASH))) == NULL) | 
| 121 | goto err0; | 121 | goto err0; | 
| 122 | if ((ret->b = reallocarray(NULL, sizeof(LHASH_NODE *), MIN_NODES)) == NULL) | 122 | if ((ret->b = reallocarray(NULL, MIN_NODES, sizeof(LHASH_NODE *))) == NULL) | 
| 123 | goto err1; | 123 | goto err1; | 
| 124 | for (i = 0; i < MIN_NODES; i++) | 124 | for (i = 0; i < MIN_NODES; i++) | 
| 125 | ret->b[i] = NULL; | 125 | ret->b[i] = NULL; | 
| diff --git a/src/lib/libcrypto/objects/obj_xref.c b/src/lib/libcrypto/objects/obj_xref.c index 8e9128efc4..2c1631e773 100644 --- a/src/lib/libcrypto/objects/obj_xref.c +++ b/src/lib/libcrypto/objects/obj_xref.c | |||
| @@ -164,7 +164,7 @@ OBJ_add_sigid(int signid, int dig_id, int pkey_id) | |||
| 164 | sigx_app = sk_nid_triple_new(sigx_cmp); | 164 | sigx_app = sk_nid_triple_new(sigx_cmp); | 
| 165 | if (!sigx_app) | 165 | if (!sigx_app) | 
| 166 | return 0; | 166 | return 0; | 
| 167 | ntr = reallocarray(NULL, sizeof(int), 3); | 167 | ntr = reallocarray(NULL, 3, sizeof(int)); | 
| 168 | if (!ntr) | 168 | if (!ntr) | 
| 169 | return 0; | 169 | return 0; | 
| 170 | ntr->sign_id = signid; | 170 | ntr->sign_id = signid; | 
| diff --git a/src/lib/libcrypto/txt_db/txt_db.c b/src/lib/libcrypto/txt_db/txt_db.c index 0f3a7ffbb3..e29a60316a 100644 --- a/src/lib/libcrypto/txt_db/txt_db.c +++ b/src/lib/libcrypto/txt_db/txt_db.c | |||
| @@ -94,9 +94,9 @@ TXT_DB_read(BIO *in, int num) | |||
| 94 | ret->qual = NULL; | 94 | ret->qual = NULL; | 
| 95 | if ((ret->data = sk_OPENSSL_PSTRING_new_null()) == NULL) | 95 | if ((ret->data = sk_OPENSSL_PSTRING_new_null()) == NULL) | 
| 96 | goto err; | 96 | goto err; | 
| 97 | if ((ret->index = reallocarray(NULL, sizeof(*ret->index), num)) == NULL) | 97 | if ((ret->index = reallocarray(NULL, num, sizeof(*ret->index))) == NULL) | 
| 98 | goto err; | 98 | goto err; | 
| 99 | if ((ret->qual = reallocarray(NULL, sizeof(*(ret->qual)), num)) == NULL) | 99 | if ((ret->qual = reallocarray(NULL, num, sizeof(*(ret->qual)))) == NULL) | 
| 100 | goto err; | 100 | goto err; | 
| 101 | for (i = 0; i < num; i++) { | 101 | for (i = 0; i < num; i++) { | 
| 102 | ret->index[i] = NULL; | 102 | ret->index[i] = NULL; | 
| diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c index 080a87d674..4aa83e027d 100644 --- a/src/lib/libcrypto/x509v3/pcy_tree.c +++ b/src/lib/libcrypto/x509v3/pcy_tree.c | |||
| @@ -220,7 +220,7 @@ tree_init(X509_POLICY_TREE **ptree, STACK_OF(X509) *certs, unsigned int flags) | |||
| 220 | return 0; | 220 | return 0; | 
| 221 | 221 | ||
| 222 | tree->flags = 0; | 222 | tree->flags = 0; | 
| 223 | tree->levels = reallocarray(NULL, sizeof(X509_POLICY_LEVEL), n); | 223 | tree->levels = reallocarray(NULL, n, sizeof(X509_POLICY_LEVEL)); | 
| 224 | tree->nlevel = 0; | 224 | tree->nlevel = 0; | 
| 225 | tree->extra_data = NULL; | 225 | tree->extra_data = NULL; | 
| 226 | tree->auth_policies = NULL; | 226 | tree->auth_policies = NULL; | 
