Skip to content

Commit a0833fb

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 1cd8edb commit a0833fb

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
@@ -2252,7 +2252,7 @@ static int wc_PKCS7_BuildSignedAttributes(wc_PKCS7* pkcs7, ESD* esd,
22522252
idx++;
22532253
}
22542254

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

0 commit comments

Comments
 (0)