Skip to content

Commit 7f21857

Browse files
Ensure esd->signedAttribsCount contains the correct count in case some are skipped by using the current idx rather than the total array size.
Thanks to Zou Dikai for the report.
1 parent b573823 commit 7f21857

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wolfcrypt/src/pkcs7.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2253,7 +2253,7 @@ static int wc_PKCS7_BuildSignedAttributes(wc_PKCS7* pkcs7, ESD* esd,
22532253
idx++;
22542254
}
22552255

2256-
esd->signedAttribsCount += cannedAttribsCount;
2256+
esd->signedAttribsCount += idx;
22572257
esd->signedAttribsSz += (word32)EncodeAttributes(
22582258
&esd->signedAttribs[atrIdx], (int)idx, cannedAttribs,
22592259
(int)cannedAttribsCount);

0 commit comments

Comments
 (0)