While reading a value from file for an integer, coverity check is giving following error
Calling function "fread" taints argument "readval"
//coverity note: Calling function "fread" taints argument "readval".
if(fread(&readval, sizeof(int), 1, fp) < 1) {
return;
} else {
//coverity note: Passing tainted variable "readval" to a tainted sink.
f1(&readval);
}
How to handle this error? What sanity checks I need to perform for 'readval' to ensure it is not corrupt.