The check for a duplicate value was reading one entry past
where it was supposed to, getting an uninitialized value.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5172)
/* Reject duplicates */
for (i = 0; i < sarg->sigalgcnt - 1; i++) {
- if (sarg->sigalgs[i] == sarg->sigalgs[sarg->sigalgcnt]) {
+ if (sarg->sigalgs[i] == sarg->sigalgs[sarg->sigalgcnt - 1]) {
sarg->sigalgcnt--;
return 0;
}