NetBSD-Bugs archive

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

bin/50965: src/usr.bin/sort/msort.c: 2 * read uninit data ?



>Number:         50965
>Category:       bin
>Synopsis:       src/usr.bin/sort/msort.c: 2 * read uninit data ?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 13 19:25:00 +0000 2016
>Originator:     David Binderman
>Release:        cvs dated 20160313
>Organization:
>Environment:
>Description:
1.

src/usr.bin/sort/msort.c:381]: (error) Uninitialized struct member: crec.data

Source code is

    crec = malloc(offsetof(RECHEADER, data[DEFLLEN]));
    crec_end = crec->data + DEFLLEN;

Looks wrong straightaway. Not sure what fix to make here.

2.

src/usr.bin/sort/msort.c:383]: (error) Uninitialized struct member: prec.data

    prec = malloc(offsetof(RECHEADER, data[DEFLLEN]));
    prec_end = prec->data + DEFLLEN;

Duplicate.

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index