qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free


From: Aurelien Jarno
Subject: Re: [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free
Date: Thu, 9 Jul 2015 17:04:54 +0200
User-agent: Mutt/1.5.23 (2014-03-12)

On 2015-07-09 16:57, Paolo Bonzini wrote:
> This was dereferencing a pointer before checking if it was NULL.
> 
> Reported-by: Christian Borntraeger <address@hidden>
> Reported-by: Aurelien Jarno <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  crypto/cipher-builtin.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index c625cb4..912c1b9 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -354,11 +354,13 @@ QCryptoCipher 
> *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
>  
>  void qcrypto_cipher_free(QCryptoCipher *cipher)
>  {
> -    QCryptoCipherBuiltin *ctxt = cipher->opaque;
> +    QCryptoCipherBuiltin *ctxt;
> +
>      if (!cipher) {
>          return;
>      }
>  
> +    ctxt = cipher->opaque;
>      ctxt->free(cipher);
>      g_free(cipher);
>  }

Thanks for the quick fix.

Reviewed-by: Aurelien Jarno <address@hidden>
Tested-by: Aurelien Jarno <address@hidden>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
address@hidden                 http://www.aurel32.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]