which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube 7.4.0.18908
what are you trying to achieve
I am trying to get the “array index out of bounds” to be reported for the below C code
void my_function(char arg1, short int arg2)
{
glbal_array_struct[0].array[arg2] = 0x12;
}
int getValueFromArray(int *array, int len, int index) {
int value;
// check that the array index is less than the maximum
// length of the array
if (index < len) {
// get the value at the specified index of the array
value = array[index];
}
// if array index is invalid then output error message
// and return value indicating error
else {
printf(“Value is: %d\n”, array[index]);
value = -1;
}
return value;
}
sorry and again: I cannot help you, you are not using the official SonarSource C/C++ analyzer, but the community one.
If you want to use official SonarSource C/C++ analyzer please install the proper version or otherwise contact the community of the community C/C++ plugin.
Hi @mpaladin
Thank you for the response. Would you be able to share the link to the official SonarSource C/C++ analyzer, I will have it installed and check for the results
The official SonarSource C/C++ analyzer is available for free in SonarCloud for open-source projects or starting with developer edition of SonarQube, have a look at this page: C/C++ analyzer