NetBSD-Bugs archive

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

bin/50546: src/usr.bin/pmap/main.c:476: possible bad size in malloc ?



>Number:         50546
>Category:       bin
>Synopsis:       src/usr.bin/pmap/main.c:476: possible bad size in malloc ?
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 13 16:55:00 +0000 2015
>Originator:     David Binderman
>Release:        cvs dated 20151210
>Organization:
>Environment:
>Description:
[src/usr.bin/pmap/main.c:476]: (warning) Size of pointer 'nchashtbl' used instead of size of its data.

Source code is

    nchashtbl = malloc(sizeof(nchashtbl) * (int)(nchash + 1));

Maybe better code

    nchashtbl = malloc(sizeof(*nchashtbl) * (int)(nchash + 1));

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index