Mapping Between CWE-658 or CWE-659 and Polyspace Bug Finder Defect Checkers
CWE™-658 and CWE-659 are a set of weaknesses specific to C and C++. The weaknesses enumerated in these subsets can be detected by using Polyspace® Bug Finder™ defect checkers and mapped to these CWE rules.
CWE-658: Weaknesses in Software Written in C
CWE-658 is a subset of common weaknesses found specifically in C programs. See CWE-658.
The following table lists the CWE rules from this subset that are addressed by Polyspace Bug Finder defects, with corresponding defect checkers.
| CWE ID | Description | Polyspace Bug Finder Defect Checker Short Name |
|---|---|---|
| 14 | Compiler Removal of Code to Clear Buffers |
|
| 119 | Improper Restriction of Operations within the Bounds of a Memory Buffer |
|
| 120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') |
|
| 121 | Stack-based Buffer Overflow |
|
| 122 | Heap-based Buffer Overflow |
|
| 123 | Write-what-where Condition |
|
| 124 | Buffer Underwrite ('Buffer Underflow') |
|
| 125 | Out-of-bounds Read |
|
| 126 | Buffer Over-read |
|
| 127 | Buffer Under-read |
|
| 128 | Wrap-around Error |
|
| 129 | Improper Validation of Array Index |
|
| 130 | Improper Handling of Length Parameter Inconsistency |
|
| 131 | Incorrect Calculation of Buffer Size |
|
| 134 | Use of Externally-Controlled Format String |
|
| 135 | Incorrect Calculation of Multi-Byte String Length |
|
| 170 | Improper Null Termination |
|
| 188 | Reliance on Data/Memory Layout |
|
| 190 | Integer Overflow or Wraparound |
|
| 191 | Integer Underflow (Wrap or Wraparound) |
|
| 192 | Integer Coercion Error |
|
| 193 | Off-by-one Error |
|
| 194 | Unexpected Sign Extension |
|
| 195 | Signed to Unsigned Conversion Error |
|
| 196 | Unsigned to Signed Conversion Error |
|
| 197 | Numeric Truncation Error |
|
| 242 | Use of Inherently Dangerous Function |
|
| 243 | Creation of chroot Jail Without Changing Working Directory |
|
| 244 | Improper Clearing of Heap Memory Before Release ('Heap Inspection') |
|
| 248 | Uncaught Exception |
|
| 362 | Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') |
|
| 364 | Signal Handler Race Condition |
|
| 366 | Race Condition within a Thread |
|
| 375 | Returning a Mutable Object to an Untrusted Caller |
|
| 396 | Declaration of Catch for Generic Exception |
|
| 397 | Declaration of Throws for Generic Exception |
|
| 401 | Missing Release of Memory after Effective Lifetime |
|
| 403 | Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak') |
|
| 415 | Double Free |
|
| 416 | Use After Free |
|
| 457 | Use of Uninitialized Variable |
|
| 463 | Deletion of Data Structure Sentinel |
|
| 464 | Addition of Data Structure Sentinel |
|
| 466 | Return of Pointer Value Outside of Expected Range |
|
| 467 | Use of sizeof() on a Pointer Type |
|
| 468 | Incorrect Pointer Scaling |
|
| 469 | Use of Pointer Subtraction to Determine Size |
|
| 474 | Use of Function with Inconsistent Implementations |
|
| 476 | NULL Pointer Dereference |
|
| 478 | Missing Default Case in Multiple Condition Expression |
|
| 479 | Signal Handler Use of a Non-reentrant Function |
|
| 480 | Use of Incorrect Operator |
|
| 481 | Assigning instead of Comparing |
|
| 482 | Comparing instead of Assigning |
|
| 483 | Incorrect Block Delimitation |
|
| 484 | Omitted Break Statement in Switch |
|
| 500 | Public Static Field Not Marked Final |
|
| 558 | Use of getlogin() in Multithreaded Application |
|
| 560 | Use of umask() with chmod-style Argument |
|
| 562 | Return of Stack Variable Address |
|
| 587 | Assignment of a Fixed Address to a Pointer |
|
| 676 | Use of Potentially Dangerous Function |
|
| 681 | Incorrect Conversion between Numeric Types |
|
| 685 | Function Call With Incorrect Number of Arguments |
|
| 690 | Unchecked Return Value to NULL Pointer Dereference |
|
| 704 | Incorrect Type Conversion or Cast |
|
| 733 | Compiler Optimization Removal or Modification of Security-critical Code |
|
| 762 | Mismatched Memory Management Routines |
|
| 763 | Release of Invalid Pointer or Reference |
|
| 766 | Critical Data Element Declared Public |
|
| 767 | Access to Critical Private Variable via Public Method |
|
| 783 | Operator Precedence Logic Error |
|
| 785 | Use of Path Manipulation Function without Maximum-sized Buffer |
|
| 786 | Access of Memory Location Before Start of Buffer |
|
| 787 | Out-of-bounds Write |
|
| 788 | Access of Memory Location After End of Buffer |
|
| 789 | Memory Allocation with Excessive Size Value |
|
| 805 | Buffer Access with Incorrect Length Value |
|
| 806 | Buffer Access Using Size of Source Buffer |
|
| 824 | Access of Uninitialized Pointer |
|
| 825 | Expired Pointer Dereference |
|
| 839 | Numeric Range Comparison Without Minimum Check |
|
| 910 | Use of Expired File Descriptor |
|
| 911 | Improper Update of Reference Count |
|
| 1335 | Incorrect Bitwise Shift of Integer |
|
| 1341 | Multiple Releases of Same Resource or Handle |
|
CWE-659: Weaknesses in Software Written in C++
CWE-659 is a subset of common weaknesses found specifically in C++ programs. See CWE-659.
The following table lists the CWE rules from this subset that are addressed by Polyspace Bug Finder defects, with corresponding defect checkers.
| CWE ID | Description | Polyspace Bug Finder Defect Checker Short Name |
|---|---|---|
| 119 | Improper restriction of operations within the bounds of a memory buffer |
|
| 120 | Buffer copy without checking size of input ('Classic buffer overflow') |
|
| 121 | Stack-based buffer overflow |
|
| 122 | Heap-based buffer overflow |
|
| 124 | Buffer underwrite ('Buffer underflow') |
|
| 125 | Out-of-bounds read |
|
| 126 | Buffer over-read |
|
| 127 | Buffer under-read |
|
| 128 | Wrap-around error |
|
| 129 | Improper validation of array index |
|
| 130 | Improper handling of length parameter inconsistency |
|
| 131 | Incorrect calculation of buffer size |
|
| 134 | Use of Externally-Controlled Format String |
|
| 135 | Incorrect Calculation of Multi-Byte String Length |
|
| 170 | Improper null termination |
|
| 188 | Reliance on data/memory layout |
|
| 191 | Integer underflow (Wrap or wraparound) |
|
| 192 | Integer coercion error |
|
| 194 | Unexpected sign extension |
|
| 195 | Signed to unsigned conversion error |
|
| 196 | Unsigned to signed conversion error |
|
| 197 | Numeric truncation error |
|
| 242 | Use of inherently dangerous function |
|
| 243 | Creation of chroot jail without changing working directory |
|
| 244 | Improper Clearing of Heap Memory Before Release ('Heap Inspection') |
|
| 362 | Concurrent execution using shared resource with improper synchronization ('Race Condition') |
|
| 364 | Signal handler race condition |
|
| 366 | Race condition within a thread |
|
| 375 | Returning a mutable object to an untrusted caller |
|
| 401 | Missing Release of Memory after Effective Lifetime |
|
| 415 | Double free |
|
| 416 | Use after free |
|
| 457 | Use of uninitialized variable |
|
| 466 | Return of pointer value outside of expected range |
|
| 467 | Use of sizeof() on a pointer type |
|
| 468 | Incorrect pointer scaling |
|
| 469 | Use of pointer subtraction to determine size |
|
| 476 | NULL pointer dereference |
|
| 478 | Missing Default Case in Multiple Condition Expression |
|
| 479 | Signal handler use of a non-reentrant function |
|
| 480 | Use of incorrect operator |
|
| 481 | Assigning instead of comparing |
|
| 482 | Comparing instead of assigning |
|
| 483 | Incorrect block delimitation |
|
| 484 | Omitted break statement in switch |
|
| 558 | Use of getlogin() in multithreaded application |
|
| 562 | Return of stack variable address |
|
| 587 | Assignment of a fixed address to a pointer |
|
| 676 | Use of potentially dangerous function |
|
| 690 | Unchecked return value to null pointer dereference |
|
| 704 | Incorrect type conversion or cast |
|
| 762 | Mismatched memory management routines |
|
| 767 | Access to critical private variable via public method |
|
| 783 | Operator precedence logic error |
|
| 785 | Use of path manipulation function without maximum-sized buffer |
|
| 787 | Out-of-bounds write |
|
| 789 | Memory Allocation with Excessive Size Value |
|
| 805 | Buffer access with incorrect length value |
|
| 910 | Use of expired file descriptor |
|