Skip to content

Commit 684092e

Browse files
committed
fix scan-build warnings
1 parent 4a2bdc7 commit 684092e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/encauth/ccm/ccm_memory.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ int ccm_memory(int cipher,
8484
if (*taglen < 4 || *taglen > 16 || (*taglen % 2) == 1) {
8585
return CRYPT_INVALID_ARG;
8686
}
87+
if (noncelen < 7) {
88+
return CRYPT_INVALID_ARG;
89+
}
8790

8891
/* is there an accelerator? */
8992
if (cipher_descriptor[cipher].accel_ccm_memory != NULL) {
@@ -147,7 +150,7 @@ int ccm_memory(int cipher,
147150
(L-1));
148151

149152
/* nonce */
150-
for (y = 0; y < (16 - (L + 1)); y++) {
153+
for (y = 0; y < noncelen; y++) {
151154
PAD[x++] = nonce[y];
152155
}
153156

0 commit comments

Comments
 (0)