projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d09a6fd
)
crypto: fix builtin qcrypto_cipher_free
author
Paolo Bonzini
<pbonzini@redhat.com>
Thu, 9 Jul 2015 14:52:48 +0000
(16:52 +0200)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Thu, 9 Jul 2015 14:53:45 +0000
(16:53 +0200)
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
patch
|
blob
|
history
diff --git
a/crypto/cipher-builtin.c
b/crypto/cipher-builtin.c
index c625cb40f768542b3fa8c18738ffacb2bae1da09..912c1b947dbe03630ebc63fadec9404644b2c8e1 100644
(file)
--- 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);
}