From: Aurelien Jarno <aurelien@aurel32.net>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free
Date: Thu, 9 Jul 2015 17:04:54 +0200 [thread overview]
Message-ID: <20150709150454.GH11361@aurel32.net> (raw)
In-Reply-To: <1436453830-4700-3-git-send-email-pbonzini@redhat.com>
On 2015-07-09 16:57, Paolo Bonzini wrote:
> This was dereferencing a pointer before checking if it was NULL.
>
> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reported-by: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> 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 <aurelien@aurel32.net>
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2015-07-09 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 14:57 [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Paolo Bonzini
2015-07-09 14:57 ` [Qemu-devel] [PULL 1/2] migration: fix RCU deadlock Paolo Bonzini
2015-07-09 14:57 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Paolo Bonzini
2015-07-09 15:04 ` Aurelien Jarno [this message]
2015-07-09 15:19 ` [Qemu-devel] [PULL for-2.4-rc0 0/2] Urgent fixes for 2.4 Christian Borntraeger
2015-07-09 15:21 ` Peter Maydell
2015-07-09 16:28 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150709150454.GH11361@aurel32.net \
--to=aurelien@aurel32.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.