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
Boolean value assigned to pointer.
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
Invalid usage of output stream: '<< std::cout'.
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
Possible dereference of an invalid iterator
Memory freed twice
Value used after being erased
Float conversation overflow
Integer overflow
Invalid container
Calling 'erase' while iterating the container is invalid.
Invalid function argument
Invalid boolean argument
Invalid string argument
Invalid use of scope/variable lifetime
scanf call overwrite the memory allocated for the string
I/O operations without positioning
Same iterator is used with different scopes
Allocation failed
return value of function not stored
Memory leak: table.array
Common realloc mistake: value nulled but not freed upon failure
Mismatching allocation and deallocation
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.
Reference to temporary returned.
Member variable is initialized by itself.
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
Modifying string literal directly or indirectly is undefined behaviour.
Unusual pointer arithmetic.
Exception thrown in function declared not to throw exceptions.
Memory is allocated but not initialized
Uninitialized struct member
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.
Class which is inherited does not have a virtual destructor.
Write operation on a file that was opened only for reading.
mismatch printf parameters
Division by zero.
Missing return statement
We use cookies to improve your site experience, including analytics cookies to understand how you use our product and design better experiences. Please read our Cookie Policy.