NetBSD-Bugs archive

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

port-evbarm/51150: src/sys/arch/evbarm/imx7/imx7_machdep.c: possible read uninit memory ?



>Number:         51150
>Category:       port-evbarm
>Synopsis:       src/sys/arch/evbarm/imx7/imx7_machdep.c: possible read uninit memory ?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 18 13:20:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160518
>Organization:
>Environment:
>Description:
[src/sys/arch/evbarm/imx7/imx7_machdep.c:222]: (error) Uninitialized variable: memsize

Source code is

#ifdef MEMSIZE
    memsize = MEMSIZE * 1024 * 1024;
#endif

    bootconfig.dramblocks = 1;
    bootconfig.dram[0].address = KERN_VTOPHYS(KERNEL_BASE);
    bootconfig.dram[0].pages = memsize / PAGE_SIZE;

but

   psize_t memsize;

Suggest init local variable memsize at its declaration.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index