]> Git Repo - qemu.git/commitdiff
crypto: fix getter of a QCryptoSecret's property
authorTong Ho <[email protected]>
Thu, 9 Jan 2020 20:09:58 +0000 (12:09 -0800)
committerDaniel P. BerrangĂ© <[email protected]>
Thu, 7 May 2020 11:48:41 +0000 (12:48 +0100)
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 <[email protected]>
Signed-off-by: Daniel P. BerrangĂ© <[email protected]>
crypto/secret.c

index 1cf0ad0ce8584b1a7d58edf04d2977706eb04295..5fb6bbe59c55edb87576b2b1ca7adbf9891049dc 100644 (file)
@@ -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;
 }
 
 
This page took 0.027108 seconds and 4 git commands to generate.