diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-02-26 10:48:17 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-02-26 10:48:17 +0000 |
commit | 8026e1ae6918b0837b93da08526d59bf68da2448 (patch) | |
tree | b98500d99c929e59e0b31974a6f89bb685807b57 /lib/libssl | |
parent | b46f88af58a8d288797f9ac76d7aef32576d1360 (diff) |
fix memory leak (in one case of unaligned buffers); from Markus Kvetter
ok markus
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/src/crypto/engine/hw_cryptodev.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c index d3b186c1324..a98f5d7e578 100644 --- a/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/lib/libssl/src/crypto/engine/hw_cryptodev.c @@ -693,8 +693,9 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp); - if (ISUNALIGNED(out)) { - bcopy(spare, out, inl); + if (ISUNALIGNED(in) || ISUNALIGNED(out)) { + if (ISUNALIGNED(out)) + bcopy(spare, out, inl); free(spare); } |