diff options
author | Tong Ho <tong.ho@xilinx.com> | 2020-01-09 12:09:58 -0800 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2020-05-07 12:48:41 +0100 |
commit | 569644f761f704901b70bd259762c60b7cb28634 (patch) | |
tree | f6a9e2477fccb6d376e2e571d0be142e5326fe44 /crypto | |
parent | 609dd53df540edd72faee705205aceca9c42fea5 (diff) | |
download | qemu-569644f761f704901b70bd259762c60b7cb28634.zip qemu-569644f761f704901b70bd259762c60b7cb28634.tar.gz qemu-569644f761f704901b70bd259762c60b7cb28634.tar.bz2 |
crypto: fix getter of a QCryptoSecret's property
This fixes the condition-check done by the "loaded" property
getter, such that the property returns true even when the
secret is loaded by the 'file' option.
Signed-off-by: Tong Ho <tong.ho@xilinx.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/secret.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/secret.c b/crypto/secret.c index 1cf0ad0..5fb6bbe 100644 --- a/crypto/secret.c +++ b/crypto/secret.c @@ -221,6 +221,7 @@ qcrypto_secret_prop_set_loaded(Object *obj, secret->rawlen = inputlen; } else { g_free(secret->rawdata); + secret->rawdata = NULL; secret->rawlen = 0; } } @@ -231,7 +232,7 @@ qcrypto_secret_prop_get_loaded(Object *obj, Error **errp G_GNUC_UNUSED) { QCryptoSecret *secret = QCRYPTO_SECRET(obj); - return secret->data != NULL; + return secret->rawdata != NULL; } |