NetBSD-Bugs archive

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

bin/53910: sleep(1) accepts invalid arguments



	Note: There was a bad value `' for the field `Confidential'.
	It was set to the default value of `yes'.

>Number:         53910
>Category:       bin
>Synopsis:       sleep(1) accepts invalid arguments
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 25 22:20:01 +0000 2019
>Originator:     David Holland
>Release:        NetBSD 8.99.27 (20181205)
>Organization:
>Environment:
System: NetBSD macaran 8.99.27 NetBSD 8.99.27 (MACARAN) #50: Wed Dec 5 19:34:11 EST 2018 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

You might think sleep accepts "m" and "h" for hours and minutes:
	% sleep 30m
	(waits)
	% sleep 5h
	(waits)

but you'd be wrong:
	% time sleep 1m
	0.000u 0.000s 0:01.00 0.0%      0+0k 0+0io 0pf+0w

It should validate the input and reject non-numbers.

>How-To-Repeat:

>Fix:

don't use atof() where these inputs are undefined behavior.



Home | Main Index | Thread Index | Old Index