NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/50998: src/bin/pax/ar_io.c:1686: possible missing sanity check ?

>Number:         50998
>Category:       bin
>Synopsis:       src/bin/pax/ar_io.c:1686: possible missing sanity check ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 24 11:45:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160324
src/bin/pax/ar_io.c:1686]: (style) Variable 'len' is assigned a value that is never used.

Source code is

       len = snprintf(buf, sizeof(buf),
            "%s vol %d, %lu files, %s read, %s written in %s\n",
            frmt->name, arvol-1, (unsigned long)flcnt,
            sizefmt(s1buf, sizeof(s1buf), rdcnt),
            sizefmt(s2buf, sizeof(s2buf), wrcnt),
            timefmt(tbuf, sizeof(tbuf), rdcnt + wrcnt, secs, "bytes"));
    if (n == 0)
        (void)fprintf(outf, "%s: %s", argv0, buf);
        (void)write(STDERR_FILENO, buf, strlen(buf));

Suggest either sanity check value of len or remove assignment to len.


Home | Main Index | Thread Index | Old Index