NetBSD-Bugs archive

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

bin/50867: src/usr.sbin/grfconfig/grfconfig.c:165: array index used before sanity check ?



>Number:         50867
>Category:       bin
>Synopsis:       src/usr.sbin/grfconfig/grfconfig.c:165: array index used before sanity check ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 29 17:30:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160229
>Organization:
>Environment:
>Description:
[src/usr.sbin/grfconfig/grfconfig.c:165]: (style) Array index 'i' is used before limits check.

            for (i = 0, *cps = strtok(buf, " \b\t\r\n");
                cps[i] != NULL && i < 30; i++)
                cps[i + 1] = strtok(NULL, " \b\t\r\n");

Suggest sanity check array index before use.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index