Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data race in asn1_str2tag() on tntmp which was accidentally made …
…static Variables tntmp and tnst are declared in the same declaration and thus share storage class specifiers (static). This is unfortunate as tntmp is used during iteration through tnst array and shouldn't be static. In particular this leads to two problems that may arise when multiple threads are executing asn1_str2tag() concurrently: 1. asn1_str2tag() might return value that doesn't correspond to tagstr parameter. This can happen if other thread modifies tntmp to point to a different tnst element right after a successful name check in the if statement. 2. asn1_str2tag() might perform an out-of-bounds read of tnst array. This can happen when multiple threads all first execute tntmp = tnst; line and then start executing the loop. If that case those threads can end up incrementing tntmp past the end of tnst array. CLA: trivial Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Shane Lontis <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#26504)
- Loading branch information