From 2e73df32e9d83c940faaf71fcaf4b01ed708ac41 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 26 Feb 2008 10:48:16 +0000 Subject: fix memory leak (in one case of unaligned buffers); from Markus Kvetter ok markus --- lib/libssl/src/crypto/engine/hw_cryptodev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libssl/src/crypto/engine/hw_cryptodev.c') 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); } -- cgit v1.2.3-59-g8ed1b