Expression is Always TrueID: 571 | Date: (C)2012-05-14 (M)2022-10-10 |
Type: weakness | Status: DRAFT |
Abstraction Type: Variant |
Description
The software contains an expression that will always evaluate
to true.
Applicable PlatformsLanguage Class: All
Time Of Introduction
Common Consequences
Scope | Technical Impact | Notes |
---|
Other | Quality degradationVaries by context | |
Detection MethodsNone
Potential Mitigations
Phase | Strategy | Description | Effectiveness | Notes |
---|
Testing | | Use Static Analysis tools to spot such conditions. | | |
Relationships
Related CWE | Type | View | Chain |
---|
CWE-571 ChildOf CWE-885 | Category | CWE-888 | |
Demonstrative Examples (Details)
- In the following Java example the updateInventory() method used
within an e-business product ordering/inventory application will check if
the input product number is in the store or in the warehouse. If the product
is found, the method will update the store or warehouse database as well as
the aggregate product database. If the product is not found, the method
intends to do some special processing without updating any database.
White Box Definitions None
Black Box Definitions None
Taxynomy Mappings
Taxynomy | Id | Name | Fit |
---|
CERT C Secure Coding | MSC00-C | Compile cleanly at high warning levels | |
CERT C++ Secure Coding | MSC00-CPP | Compile cleanly at high warning levels | |
References:None