|
|
|
|
CWE-606: Unchecked Input for Loop Condition | |
| | Unchecked Input for Loop Condition |
|
| Weakness ID: 606 (Weakness Base) | | Status: Draft |
Description
Description Summary The product does not properly check inputs that are used for
loop conditions, potentially leading to a denial of service because of excessive
looping.
Time of Introduction Demonstrative Examples Example 1 (Bad Code) C void iterate(int n){
int i;
for (i = 0; i < n; i++){
}
} void iterateFoo() {
unsigned num;
scanf("%u",&num);
iterate(num);
} Potential Mitigations | Phase | Description |
| Do not use user-controlled data for loop conditions. |
| Perform input validation. |
Relationships Taxonomy Mappings | Mapped Taxonomy Name | Node ID | Fit | Mapped Node Name |
| Anonymous Tool Vendor (under NDA) | | | |
| CERT C Secure Coding | INT03-C | | Use a secure integer library |
Content History | Submissions |
|---|
| Submission Date | Submitter | Organization | Source |
|---|
| Anonymous Tool Vendor (under NDA) | | Externally Mined | | | Modifications |
|---|
| Modification Date | Modifier | Organization | Source |
|---|
| 2008-07-01 | Eric Dalci | Cigital | External | | updated Potential Mitigations,
Time of Introduction | | 2008-09-08 | CWE Content Team | MITRE | Internal | | updated Relationships, Taxonomy Mappings,
Type | | 2008-11-24 | CWE Content Team | MITRE | Internal | | updated Relationships,
Taxonomy Mappings | | 2009-05-27 | CWE Content Team | MITRE | Internal | | updated Demonstrative Examples | | 2009-10-29 | CWE Content Team | MITRE | Internal | | updated Relationships |
|