Logic & Control Flow Bugs
[6 examples] Array index out of boundsProgram accesses invalid array indexes, causing crashes or errors. memoryundefined behavioredge case |
[8 examples] Buffer overflowData exceeds allocated memory, risking crashes or security issues. memorysecurityc++ |
[1 examples] Divide by zeroAttempted division using zero, causing runtime errors or crashes. logicedge caseundefined behavior |
[1 examples] Uninitialized variableVariable used without an assigned value, causing unpredictable behavior. undefined behaviorlogicc++ |
[2 examples] Variable shadowingInner variable hides an outer one, leading to confusion or bugs. code qualitylogicdebugging |
[20 examples] Unreachable codeCode segment that can never execute, wasting resources. logiccode qualitydebugging |
[29 examples] Integer overflowInteger exceeds the maximum allowed value, leading to incorrect results. logicundefined behaviorc++ |
[1 examples] Integer underflowInteger drops below the minimum allowed value, causing unexpected behavior. logicundefined behaviorc++ |
[3 examples] Loss of precisionNumeric data precision lost during calculations, causing errors. type systemdata integrityc++ |
[2 examples] Incorrect assignmentValue incorrectly assigned, causing unintended outcomes. logiccode quality |
[150 examples] Logic errorLogical mistake resulting in incorrect outcomes. logiccode quality |
[2 examples] Incorrect operator precedenceOperators evaluated in the wrong order, causing logical errors. logicedge case |
[7 examples] Off-by-one errorCalculation errors from loop or array indexes off by one. logicedge case |
Want to avoid this bug in your codebase? Try Greptile.
Avoid this bug!