summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509v3
diff options
context:
space:
mode:
authorderaadt <>2014-05-29 21:07:43 +0000
committerderaadt <>2014-05-29 21:07:43 +0000
commit642d45ae22413aa8195b105d051ca8896e782c5d (patch)
treed5fe0c330801f3e72c7b588264c6027636db4330 /src/lib/libcrypto/x509v3
parentf60b3b3365842d8869513a7e36981671cd726939 (diff)
downloadopenbsd-642d45ae22413aa8195b105d051ca8896e782c5d.tar.gz
openbsd-642d45ae22413aa8195b105d051ca8896e782c5d.tar.bz2
openbsd-642d45ae22413aa8195b105d051ca8896e782c5d.zip
convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53
potential integer overflows easily changed into an allocation return of NULL, with errno nicely set if need be. checks for an allocations returning NULL are commonplace, or if the object is dereferenced (quite normal) will result in a nice fault which can be detected & repaired properly. ok tedu
Diffstat (limited to 'src/lib/libcrypto/x509v3')
-rw-r--r--src/lib/libcrypto/x509v3/pcy_tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509v3/pcy_tree.c b/src/lib/libcrypto/x509v3/pcy_tree.c
index ebc4809371..080a87d674 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 = malloc(sizeof(X509_POLICY_LEVEL) * n); 223 tree->levels = reallocarray(NULL, sizeof(X509_POLICY_LEVEL), n);
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;