<p>To answer your question: static analysis tools (like FlawFinder) can generate a <em>LOT</em> of &quot;false positives&quot;.</p>
<p>I Googled to find some quantifiable information for you, and found an interesting article about &quot;DeFP&quot;:</p>
<blockquote>
<p><a href="https://arxiv.org/pdf/2110.03296.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/2110.03296.pdf</a></p>
<p>Static analysis tools are frequently used to detect potential
vulnerabilities in software systems. However, an inevitable problem of
these tools is their large number of warnings with a high false
positive rate, which consumes time and effort for investigating. In
this paper, we present DeFP, a novel method for ranking static analysis warnings.</p>
<p>Based on the intuition that warnings which have
similar contexts tend to have similar labels (true positive or false
positive), DeFP is built with two BiLSTM models to capture the
patterns associated with the contexts of labeled warnings. After that,
for a set of new warnings, DeFP can calculate and rank them according
to their likelihoods to be true positives (i.e., actual
vulnerabilities).</p>
<p>Our experimental results on a dataset of 10
real-world projects show that using DeFP, by investigating only 60% of
the warnings, developers can find
+90% of actual vulnerabilities. Moreover, DeFP improves the state-of-the-art approach 30% in both Precision and Recall.</p>
</blockquote>
<p>Apparently, the authors built a neural network to analyze FlawFinder results, and rank them.</p>
<p>I doubt DeFP is a practical &quot;solution&quot; for you.  But yes: if you think that specific &quot;memcpy()&quot; warning is a &quot;false positive&quot; - then I'm inclined to agree. It very well could be :)</p>
How much can we trust to warnings generated by static analysis tools for vulnerablity detection?
<p>I am running flawfinder on a set of libraries written in C/C++. I have a lot of generated warnings by flawfinder. My question is that, how much I can rely on these generated warnings? For example, consider the following function from numpy library (<a href="https://github.com/numpy/numpy/blob/4ada0641ed1a50a2473f8061f4808b4b0d68eff5/numpy/f2py/src/fortranobject.c" rel="nofollow noreferrer">https://github.com/numpy/numpy/blob/4ada0641ed1a50a2473f8061f4808b4b0d68eff5/numpy/f2py/src/fortranobject.c</a>):</p>
<pre><code>static PyObject *
fortran_doc(FortranDataDef def)
{
    char *buf, *p;
    PyObject *s = NULL;
    Py_ssize_t n, origsize, size = 100;

    if (def.doc != NULL) {
        size += strlen(def.doc);
    }
    origsize = size;
    buf = p = (char *)PyMem_Malloc(size);
    if (buf == NULL) {
        return PyErr_NoMemory();
    }

    if (def.rank == -1) {
        if (def.doc) {
            n = strlen(def.doc);
            if (n &gt; size) {
                goto fail;
            }
            memcpy(p, def.doc, n);
            p += n;
            size -= n;
        }
        else {
            n = PyOS_snprintf(p, size, &quot;%s - no docs available&quot;, def.name);
            if (n &lt; 0 || n &gt;= size) {
                goto fail;
            }
            p += n;
            size -= n;
        }
    }
    else {
        PyArray_Descr *d = PyArray_DescrFromType(def.type);
        n = PyOS_snprintf(p, size, &quot;'%c'-&quot;, d-&gt;type);
        Py_DECREF(d);
        if (n &lt; 0 || n &gt;= size) {
            goto fail;
        }
        p += n;
        size -= n;

        if (def.data == NULL) {
            n = format_def(p, size, def) == -1;
            if (n &lt; 0) {
                goto fail;
            }
            p += n;
            size -= n;
        }
        else if (def.rank &gt; 0) {
            n = format_def(p, size, def);
            if (n &lt; 0) {
                goto fail;
            }
            p += n;
            size -= n;
        }
        else {
            n = strlen(&quot;scalar&quot;);
            if (size &lt; n) {
                goto fail;
            }
            memcpy(p, &quot;scalar&quot;, n);
            p += n;
            size -= n;
        }
    }
    if (size &lt;= 1) {
        goto fail;
    }
    *p++ = '\n';
    size--;

    /* p now points one beyond the last character of the string in buf */
#if PY_VERSION_HEX &gt;= 0x03000000
    s = PyUnicode_FromStringAndSize(buf, p - buf);
#else
    s = PyString_FromStringAndSize(buf, p - buf);
#endif

    PyMem_Free(buf);
    return s;

 fail:
    fprintf(stderr, &quot;fortranobject.c: fortran_doc: len(p)=%zd&gt;%zd=size:&quot;
                    &quot; too long docstring required, increase size\n&quot;,
            p - buf, origsize);
    PyMem_Free(buf);
    return NULL;
}
</code></pre>
<p>There are two memcpy() API calls, and flawfinder tells me that:</p>
<pre><code>['vul_fortranobject.c:216: [2] (buffer) memcpy:\\n Does not check for buffer overflows when copying to destination (CWE-120).\\n Make sure destination can always hold the source data.\\n memcpy(p, &quot;scalar&quot;, n);']
</code></pre>
<p>I am not sure whether the report is true.</p>