NetBSD/bin
kamil 7806b47917 Rework perform_arith_op() in expr(1) to omit Undefined Behavior
The current implementation of operations - + * / % could cause Undefined
Behavior and in narrow cases (INT64_MIN / -1 and INT64_MIN % -1) SIGFPE
and crash duping core.

Detected with MKSANITIZER enabled for the Undefined Behavior variation:
# eval expr '4611686018427387904 + 4611686018427387904'
/public/src.git/bin/expr/expr.y:315:12: runtime error: signed integer overflow: 4611686018427387904 + 4611686018427387904 cannot be represented in type 'long'

All bin/t_expr ATF tests pass now in a sanitized userland.

Sponsored by <The NetBSD Foundation>
2018-06-12 18:12:18 +00:00
..
cat Add cross reference to tac(1). 2017-10-02 08:24:17 +00:00
chio typo: unvalid -> invalid 2017-10-16 17:08:35 +00:00
chmod Use Ex. 2017-07-04 06:46:51 +00:00
cp Document the version cp first appeared. 2016-08-11 00:17:23 +00:00
csh use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
date Remove trailing whitespace and Tn macro. 2018-01-27 18:59:38 +00:00
dd Use Ex. 2017-07-04 06:46:51 +00:00
df Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
domainname
echo Use Ex. 2017-07-04 06:46:51 +00:00
ed Sort option descripts, fix markups, fix typos. 2018-04-09 06:57:01 +00:00
expr Rework perform_arith_op() in expr(1) to omit Undefined Behavior 2018-06-12 18:12:18 +00:00
hostname
kill Make arg parsing in kill POSIX compatible with POSIX (XBD 2.12) by 2017-06-26 22:09:16 +00:00
ksh Change typ of tilde_ok from int to unsigned int in ksh(1) 2018-06-12 14:13:55 +00:00
ln When called as "link" (not currently installed that way) always simply 2017-04-22 12:22:31 +00:00
ls Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
mkdir Use Ex. Remove superfluous Pp. 2017-07-04 06:49:35 +00:00
mt
mv Use Ex. 2017-07-04 06:50:04 +00:00
pax s/copy copy/copy/ in comment. 2018-03-19 03:11:39 +00:00
ps kvm_geterr() already contains errno, use errx. 2018-04-11 18:52:29 +00:00
pwd Use Ex. 2017-07-04 06:50:04 +00:00
rcmd Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
rcp
rm Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
rmdir PR/48182: Fix rmdir -p handling of top-level (root) directory. 2017-08-10 22:52:13 +00:00
sh use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
sleep Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
stty Remove Tn. 2017-10-30 15:38:52 +00:00
sync Drop main() prototype. 2016-09-05 01:00:07 +00:00
test Remove unnecessary Tn. 2017-10-18 18:11:54 +00:00
Makefile
Makefile.inc