I\'m running Coverity tool in my file operation function and getting the following error.
As you can see below, I\'m using an snprintf() before passing this variable
Error:TAINTED_STRING
is warning that (as far as Coverity can tell) some aspect of the behaviour is influenced by some external input and that the external input is not examined for 'safeness' before it influences execution.
In this particular example it would appear that Coverity is wrong because the value of LOG_FILE is "/log/test%d.log" and is used with an int
in the snprintf
, meaning that the content of char fn[100]
is always well defined.
So a reasonable course of action would be to mark the error as a non-issue so that it is ignored on future runs.