From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free
Date: Thu, 9 Jul 2015 16:57:10 +0200 [thread overview]
Message-ID: <1436453830-4700-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1436453830-4700-1-git-send-email-pbonzini@redhat.com>
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);
}
--
2.4.3
next prev parent reply other threads:[~2015-07-09 14:57 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 ` Paolo Bonzini [this message]
2015-07-09 15:04 ` [Qemu-devel] [PULL 2/2] crypto: fix builtin qcrypto_cipher_free Aurelien Jarno
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=1436453830-4700-3-git-send-email-pbonzini@redhat.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).