Add Coverity annotations for three issues so that Coverity scans of
open-vm-tools will automatically classify these issues as
"Intentional." These annotations are useful both for internal
use as well as for partners who run Coverity scans on open-vm-tools.
if (len == 0) {
g_warning("Invalid path for domain '%s'.", domain);
g_free(origPath);
+ /*
+ * Coverity flags this as a possible copy-paste error but assigning
+ * to path rather than origPath is correct.
+ */
+ /* coverity[copy_paste_error] */
path = NULL;
} else {
/* Drop the trailing '"' chars */
break;
}
}
+ /*
+ * Coverity flags this invocation of CLOSE_MNTFILE because the macro does
+ * a test whose results are ignored. However, it also has a needed side
+ * effect, so this invocation is correct.
+ */
+ /* coverity[no_effect_test] */
CLOSE_MNTFILE(mtab);
exit:
goto abort;
}
}
+ /*
+ * Coverity flags this invocation of CLOSE_MNTFILE because the macro does
+ * a test whose results are ignored. However, it also has a needed side
+ * effect, so this invocation is correct.
+ */
+ /* coverity[no_effect_test] */
CLOSE_MNTFILE(fp);
#else
err = VIX_E_NOT_SUPPORTED;