Fix initialization races in X509CertImpl
X509CertImpl instances can be shared between threads without a caller knowing due to the CERT_CACHE in X509CertFactoryImpl. In some cases, initialization of pairs of fields such as notBefore/notAfter and sigAlgOID/sigAlgName were protected by checking if only was one of the two values were initialized. This could lead to one thread half initializing a pair and a second thread seeing the half initialized pair, would assume both halves were initialized, returning an uninitialized value. Even in the lazy initialization of single fields there was no use of volatile or synchonized to be properly safe. Change-Id: Ia7d6238927d0e77f4f2a512458eac66e97f2abbb http://code.google.com/p/android/issues/detail?id=11870 Bug: 2295023
Showing
Please register or sign in to comment