qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] crypto/secret: fix inconsequential errors.


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/2] crypto/secret: fix inconsequential errors.
Date: Wed, 22 Apr 2020 18:04:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

On 4/15/20 10:13 PM, Alexey Krasikov wrote:
* change condition from QCRYPTO_SECRET_FORMAT_RAW
   to QCRYPTO_SECRET_FORMAT_BASE64 in if-operator, because
   this is potencial error if you add another format value.

Signed-off-by: Alexey Krasikov <address@hidden>
---
  crypto/secret.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/secret.c b/crypto/secret.c
index 1cf0ad0ce8..546b965afe 100644
--- a/crypto/secret.c
+++ b/crypto/secret.c
@@ -204,7 +204,7 @@ qcrypto_secret_prop_set_loaded(Object *obj,
              input = output;
              inputlen = outputlen;
          } else {
-            if (secret->format != QCRYPTO_SECRET_FORMAT_RAW) {
+            if (secret->format == QCRYPTO_SECRET_FORMAT_BASE64) {
                  qcrypto_secret_decode(input, inputlen,
                                        &output, &outputlen, &local_err);
                  g_free(input);


Reviewed-by: Philippe Mathieu-Daudé <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]