clear-pkgs-linux-iot-lts2018/0865-Security-Fix-copy-wron...

34 lines
1.1 KiB
Diff
Raw Normal View History

From a7c6f2993bcf787f13013995d02f951929677247 Mon Sep 17 00:00:00 2001
From: Zhou Furong <furong.zhou@intel.com>
Date: Fri, 4 Jan 2019 08:59:45 +0800
Subject: [PATCH 07/11] Security: Fix copy wrong size of keystore client id
Copy wrong size of keystore client id by mistake.
Tracked-On: PKT-1640
Signed-off-by: Zhou Furong <furong.zhou@intel.com>
Change-Id: Ibb90ad0fe1d87615170c4b1636ca7a68b08964a4
---
security/keystore/api_dal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/security/keystore/api_dal.c b/security/keystore/api_dal.c
index 31c351e18456..d97dd469d404 100644
--- a/security/keystore/api_dal.c
+++ b/security/keystore/api_dal.c
@@ -112,8 +112,8 @@ static int dal_keystore_register_client(enum keystore_seed_type seed_type,
goto err;
}
- memcpy(input, client_id, sizeof(client_id));
- index += sizeof(client_id);
+ memcpy(input, client_id, KEYSTORE_MAX_CLIENT_ID_SIZE);
+ index += KEYSTORE_MAX_CLIENT_ID_SIZE;
memcpy(input + index, client_ticket, KEYSTORE_CLIENT_TICKET_SIZE);
index += KEYSTORE_CLIENT_TICKET_SIZE;
pack_int_to_buf(seed_type, input + index);
--
2.17.1