aboutsummaryrefslogtreecommitdiff
path: root/crypto/x509/by_dir.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-07-06 14:56:20 +1000
committerPauli <paul.dale@oracle.com>2017-07-07 15:45:55 +1000
commita2371fa93365cc0bc0e46b9d65f3a47a074b1c30 (patch)
treec4751256bc9a1e3d2b20bad3becd6b17aec2c9f4 /crypto/x509/by_dir.c
parenta7ff57965b81ce4fd73a18266ce29abf6b909fdb (diff)
downloadopenssl-a2371fa93365cc0bc0e46b9d65f3a47a074b1c30.zip
openssl-a2371fa93365cc0bc0e46b9d65f3a47a074b1c30.tar.gz
openssl-a2371fa93365cc0bc0e46b9d65f3a47a074b1c30.tar.bz2
Trivial bounds checking.
Bounds checking strpy, strcat and sprintf. These are the remaining easy ones to cover a recently removed commit. Some are trivial, some have been modified and a couple left as they are because the reverted change didn't bounds check properly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3871)
Diffstat (limited to 'crypto/x509/by_dir.c')
-rw-r--r--crypto/x509/by_dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c
index b519dc4..201ed12 100644
--- a/crypto/x509/by_dir.c
+++ b/crypto/x509/by_dir.c
@@ -295,8 +295,8 @@ static int get_cert_by_subject(X509_LOOKUP *xl, X509_LOOKUP_TYPE type,
BIO_snprintf(b->data, b->max,
"%s%08lx.%s%d", ent->dir, h, postfix, k);
} else {
- sprintf(b->data,
- "%s%c%08lx.%s%d", ent->dir, c, h, postfix, k);
+ BIO_snprintf(b->data, b->max,
+ "%s%c%08lx.%s%d", ent->dir, c, h, postfix, k);
}
#ifndef OPENSSL_NO_POSIX_IO
# ifdef _WIN32