NetBSD-Bugs archive

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

lib/56313: tests/lib/libc/sys/t_wait.c compares si_status incorrectly



>Number:         56313
>Category:       lib
>Synopsis:       tests/lib/libc/sys/t_wait.c compares si_status incorrectly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 17 13:45:00 +0000 2021
>Originator:     Jilles Tjoelker
>Release:        current as of 2021-07-17
>Organization:
The FreeBSD Project
>Environment:
problem found by code inspection
>Description:
In http://cvsweb.netbsd.org/bsdweb.cgi/src/tests/lib/libc/sys/t_wait.c?rev=1.9&content-type=text/x-cvsweb-markup&only_with_tag=MAIN I found the line:

ATF_REQUIRE(si.si_status = 0x5a5a5a5a);

This is supposed to check the value of si.si_status, but because there is = instead of ==, it assigns the value and does not check anything.

FreeBSD has imported this code to contrib/netbsd-tests/lib/libc/sys/t_wait.c; I originally found the issue there.
>How-To-Repeat:

>Fix:
Change = to == in this line.

I don't know whether the underlying functionality works correctly in the kernel if it is not tested.



Home | Main Index | Thread Index | Old Index