Skip to content

Commit 20a77d1

Browse files
test_ccm_mode: Fix wrong sizeof argument in test_ccm_mode
This commit fixes the wrong sizeof argument error reported by Coverity/Zephyr. Coverity-CID: 152032 Change-Id: Idea4a75edaf9643756a0ee516d39587acb85fee1 Signed-off-by: Flavio Santes <flavio.santes@intel.com>
1 parent 2b473b6 commit 20a77d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_ccm_mode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ void test_vector_8 (void) {
331331
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07
332332
};
333333

334-
uint8_t *data = NULL;
334+
uint8_t data[] = {};
335335

336336
struct tc_ccm_mode_struct c;
337337
struct tc_aes_key_sched_struct sched;
@@ -346,7 +346,7 @@ void test_vector_8 (void) {
346346
exit (-1);
347347
}
348348

349-
if (tc_ccm_generation_encryption (ciphertext, hdr, sizeof(hdr), data, 0, &c) == 0) {
349+
if (tc_ccm_generation_encryption (ciphertext, hdr, sizeof(hdr), data, sizeof(data), &c) == 0) {
350350
fprintf (stderr, "ccm_encrypt failed\n");
351351
exit (-1);
352352
}

0 commit comments

Comments
 (0)