arrayIndexOutOfBounds
Array accessed out of bounds
C and C++ are really performant languages and can be very error-prone. We all had core dumps and made pointer arithmetic errors! Thankfully, Codiga has hundreds of static analysis rules to flag potential errors in your C/C++ code, automate code reviews and merge with confidence.
Array accessed out of bounds
Address of local auto-variable assigned to a function parameter.
Deallocation of an global variable results in undefined behaviour.
Buffer is accessed out of bounds: Ltrans[temp].addr
Subtracting pointers that point to different objects
Out of bounds access of variable
Detect array access out of bounds
Null pointer dereference: base
Pointer arithmetic overflow
Using argument that is uninitialized
Non-local variable use pointer to local variable
Using object to temporary.
Using reference to dangling temporary.
Returning/dereferencing value after it is deallocated / released
Dereferencing variable after it is deallocated / released
Memory freed twice
Float conversation overflow
Integer overflow
Calling 'erase' while iterating the container is invalid.
Invalid function argument
Invalid string argument
Invalid use of scope/variable lifetime
scanf call overwrite the memory allocated for the string
Same iterator is used with different scopes
Memory leak: table.array
Common realloc mistake: value nulled but not freed upon failure
Possible null pointer dereference
Overflow in pointer arithmetic
No 'return' statement in non-void function causes undefined behavior.
Converting pointer arithmetic result to bool. The bool is always true unless there is undefined behaviour.
Read operation on a file that was opened only for writing.
Resource leak
Returning pointer to local variable that will be invalid when returning.
Reference to local variable returned.
Shifting by a negative value is undefined behaviour
Shifting 64-bit value by 64 bits is undefined behaviour.
Shifting signed 32-bit value by 31 bits is implementation-defined behaviour.
Undefined behavior: Variable is used as parameter and destination in sprintf().
Dangerous usage of c_str(). The value returned by c_str() is invalid after this call.
Out of bounds acess to a container
Unusual pointer arithmetic.
Exception thrown in function declared not to throw exceptions.
Uninitialized variable
Used file that is not opened.
va\_list 'argument\_list' was opened but not closed by va\_end().
va\_list 'cpy' used before va\_start() was called.
va\_start() or va\_copy() called subsequently on 'argptr' without va\_end() in between.
mismatch printf parameters
Division by zero.
Missing return statement