I am running Fortify SCA and Applications 21.1.1 on a C project and I'm obtaining a "Null pointer dereference" error in the following line:
int parameter1 = 1;
char *parameter2;
int foo = 1;
sprintf(parameter2, "%d", foo);
pFunction(parameter1, parameter2, NULL);
In a header file, pFunction
is declared as:
typedef int(*Function)(int a, char* b, char* c);
extern Function pFunction;
pFunction
definition is in an external file which I don't have access to.
I am pretty sure that is a false positive error in Fortify. Is there a suitable workaround for this?