NetBSD-Bugs archive

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

port-i386/50748: src/sys/arch/i386/stand/boot/boot2.c:270]: (style) Array index 'n' is used before limits check.



>Number:         50748
>Category:       port-i386
>Synopsis:       src/sys/arch/i386/stand/boot/boot2.c:270]: (style) Array index 'n' is used before limits check.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 02 10:40:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160131
>Organization:
>Environment:
>Description:

Source code is

        for (n = 0; bootcfg_info.banner[n]
            && n < BOOTCFG_MAXBANNER; n++)

Maybe better code

        for (n = 0; (n < BOOTCFG_MAXBANNER) 
                     && bootcfg_info.banner[n]
            ; n++)

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index