aboutsummaryrefslogtreecommitdiffstats
path: root/community/tpm2-tss/0001-FAPI-fix-bug-of-bad-type-casting.patch
blob: 869f37ff66adcf48417311604c69264f8ba2fa10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From fa57dd7b1174bf21c12d8d37535404702044f0a3 Mon Sep 17 00:00:00 2001
From: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
Date: Fri, 16 Jul 2021 15:35:23 +0200
Subject: [PATCH 1/1] FAPI: fix bug of bad type casting

Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
---
 src/tss2-fapi/ifapi_get_intl_cert.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/tss2-fapi/ifapi_get_intl_cert.c b/src/tss2-fapi/ifapi_get_intl_cert.c
index db628293..b66e0650 100644
--- a/src/tss2-fapi/ifapi_get_intl_cert.c
+++ b/src/tss2-fapi/ifapi_get_intl_cert.c
@@ -195,7 +195,8 @@ base64_encode(const unsigned char* buffer)
 static char *
 base64_decode(unsigned char* buffer, size_t len, size_t *new_len)
 {
-    size_t i, unescape_len = 0, r;
+    size_t i, r;
+    int unescape_len = 0;
     char *binary_data = NULL, *unescaped_string = NULL;
 
     LOG_INFO("Decoding the base64 encoded cert into binary form");
@@ -218,7 +219,7 @@ base64_decode(unsigned char* buffer, size_t len, size_t *new_len)
     if (curl) {
         /* Convert URL encoded string to a "plain string" */
         char *output = curl_easy_unescape(curl, (char *)buffer,
-                                          len, (int *)&unescape_len);
+                                          len, &unescape_len);
         if (output) {
             unescaped_string = strdup(output);
             curl_free(output);
-- 
2.33.0