Parcourir la source

qcacmn: fix uninitialized array elements issue

Fix the issue about using uninitialized array elements.

Change-Id: I400fae1283bdee34c2e455aae21e0d3bb122a928
CRs-Fixed: 3394984
Meng Yuan il y a 2 ans
Parent
commit
fadf69f0d9
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      qdf/linux/src/qdf_crypto.c

+ 6 - 1
qdf/linux/src/qdf_crypto.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -176,7 +177,11 @@ static inline void leftshift_onebit(const uint8_t *input, uint8_t *output)
 static void
 generate_subkey(struct crypto_aes_ctx *aes_ctx, uint8_t *k1, uint8_t *k2)
 {
-	uint8_t l[AES_BLOCK_SIZE], tmp[AES_BLOCK_SIZE];
+	uint8_t l[AES_BLOCK_SIZE] = {
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+	};
+	uint8_t tmp[AES_BLOCK_SIZE];
 	const uint8_t const_rb[AES_BLOCK_SIZE] = {
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87