NetBSD-Bugs archive

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

bin/50734: src/bin/ed/cbc.c: 2 * off by one error ?



>Number:         50734
>Category:       bin
>Synopsis:       src/bin/ed/cbc.c: 2 * off by one error ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 01 16:30:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160131
>Organization:
>Environment:
>Description:
1.

[src/bin/ed/cbc.c:306]: (style) Array index 'i' is used before limits check.

   for (i = 0; inbuf[i] && i < 16; i++)

Maybe better code

   for (i = 0; (i < 16) && inbuf[i]; i++)

2.

[src/bin/ed/cbc.c:326]: (style) Array index 'i' is used before limits check.

Duplicate.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index