diff --git a/components/bt/esp_ble_mesh/mesh_core/crypto.c b/components/bt/esp_ble_mesh/mesh_core/crypto.c index d2e6507882..7573e164fd 100644 --- a/components/bt/esp_ble_mesh/mesh_core/crypto.c +++ b/components/bt/esp_ble_mesh/mesh_core/crypto.c @@ -261,7 +261,7 @@ static int bt_mesh_ccm_decrypt(const u8_t key[16], u8_t nonce[13], } } - for (i = 0; i < aad_len; i++, j++) { + for (; i < aad_len; i++, j++) { pmsg[i] = Xn[i] ^ aad[j]; } @@ -425,7 +425,7 @@ static int bt_mesh_ccm_encrypt(const u8_t key[16], u8_t nonce[13], } } - for (i = 0; i < aad_len; i++, j++) { + for (; i < aad_len; i++, j++) { pmsg[i] = Xn[i] ^ aad[j]; }