|
Status: Draft Weakness ID: 667 (Weakness Base)Description Summary The software does not properly acquire a lock on a resource, leading to unexpected resource state changes and behaviors. Potential Mitigations Use industry standard APIs to implement locking mechanism. Demonstrative Examples In the following Java snippet, methods are defined to get and set a long field in an instance of a class that is shared across multiple threads. Because operations on double and long are nonatomic in Java, concurrent access may cause unexpected behavior. Thus, all operations on long and double fields should be synchronized. Java Example: private long someLongValue; public long getLongValue() { return someLongValue; } public void setLongValue(long l) { someLongValue = l; }
Relationships
Taxonomy Mappings
Time of Introduction Architecture and Design ImplementationContent History Modifications Sean Eidemiller. Cigital. 2008-07-01. (External) added/updated demonstrative examples Eric Dalci. Cigital. 2008-07-01. (External) updated Potential_Mitigations, Time_of_Introduction CWE Content Team. MITRE. 2008-09-08. (Internal) updated Relationships CWE Content Team. MITRE. 2008-11-24. (Internal) updated Relationships, Taxonomy_Mappings |
|
|
|||