Skip to content

Commit 12bf723

Browse files
authored
Merge pull request #661 from libtom/fix-ccm
Fix compiler warning
2 parents c4b423f + 349d56e commit 12bf723

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/encauth/ccm/ccm_add_nonce.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ int ccm_add_nonce(ccm_state *ccm,
5858
ccm->PAD[x++] = 0;
5959
}
6060
for (; y < ccm->L; y++) {
61+
if (x >= sizeof(ccm->PAD)) {
62+
return CRYPT_INVALID_ARG;
63+
}
6164
ccm->PAD[x++] = (unsigned char)((len >> 24) & 255);
6265
len <<= 8;
6366
}

0 commit comments

Comments
 (0)