Blame SOURCES/0001-tpm2_policycountertimer-Fix-an-issue-where-operandB-.patch

cecfa4
From cab7b3edcc6a44aece0642c0c2621a4bb70d449b Mon Sep 17 00:00:00 2001
cecfa4
From: Imran Desai <imran.desai@intel.com>
cecfa4
Date: Tue, 10 Mar 2020 18:19:04 -0700
cecfa4
Subject: [PATCH] tpm2_policycountertimer: Fix an issue where operandB array
cecfa4
 was reversed
cecfa4
cecfa4
Signed-off-by: Imran Desai <imran.desai@intel.com>
cecfa4
---
cecfa4
 tools/tpm2_policycountertimer.c | 5 ++++-
cecfa4
 1 file changed, 4 insertions(+), 1 deletion(-)
cecfa4
cecfa4
diff --git a/tools/tpm2_policycountertimer.c b/tools/tpm2_policycountertimer.c
cecfa4
index 1c72d525dab7..170a544f2203 100644
cecfa4
--- a/tools/tpm2_policycountertimer.c
cecfa4
+++ b/tools/tpm2_policycountertimer.c
cecfa4
@@ -81,7 +81,10 @@ static bool convert_keyvalue_to_operand_buffer(const char *value,
cecfa4
     }
cecfa4
 
cecfa4
     ctx.operand_b.size = size;
cecfa4
-    memcpy(ctx.operand_b.buffer, &data.b, size);
cecfa4
+    size_t i = 0;
cecfa4
+    for (i = 0; i < size; i++) {
cecfa4
+        ctx.operand_b.buffer[i] = *(&data.b + size - i - 1);
cecfa4
+    }
cecfa4
 
cecfa4
     return true;
cecfa4
 }
cecfa4
-- 
cecfa4
2.31.0
cecfa4