NetBSD-Bugs archive

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

port-newsmips/51014: src/sys/arch/newsmips/dev/scsi_1185.c: possible read uninit data ?



>Number:         51014
>Category:       port-newsmips
>Synopsis:       src/sys/arch/newsmips/dev/scsi_1185.c: possible read uninit data ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-newsmips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 26 15:25:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160326
>Organization:
>Environment:
>Description:
src/sys/arch/newsmips/dev/scsi_1185.c:1742]: (error) Uninitialized variable: remain_cnt

Source code is

   sent_byte = scb->sc_ctrnscnt - remain_cnt;

but

    u_int remain_cnt;

It looks as if when this preprocessor condition

# if defined(__mips__) && defined(CPU_SINGLE)

is false, then remain_cnt can be uninitialised.

Suggest init remain_cnt at its declaration.
>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index