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
The FreeBSD Project
problem found by code inspection
In 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.

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