From b89c0dd40131bd782fa134e50e256db35c015e98 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 --- src/lib/libcrypto/engine/hw_cryptodev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/engine/hw_cryptodev.c') diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index d3b186c132..a98f5d7e57 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/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-55-g6feb