Commit Graph

5 Commits

Author SHA1 Message Date
Darren Tucker 282cad2240 Import fmt_scaled.c rev 1.16 from OpenBSD.
Fix overly-conservative overflow checks on mulitplications and add checks
on additions.  This allows scan_scaled to work up to +/-LLONG_MAX (LLONG_MIN
will still be flagged as a range error).  ok millert@
2017-03-29 16:34:44 +11:00
Darren Tucker c73a229e4e Import fmt_scaled.c rev 1.15 from OpenBSD.
Collapse underflow and overflow checks into a single block.
ok djm@ millert@
2017-03-29 16:34:02 +11:00
Darren Tucker d427b73bf5 Import fmt_scaled.c rev 1.14 from OpenBSD.
Catch integer underflow in scan_scaled reported by Nicolas Iooss.
ok deraadt@ djm@
2017-03-29 16:32:57 +11:00
Damien Miller d94c1dfef2 sync fmt_scaled.c with OpenBSD
revision 1.13
date: 2017/03/11 23:37:23;  author: djm;  state: Exp;  lines: +14 -1;  commitid: jnFKyHkB3CEiEZ2R;
fix signed integer overflow in scan_scaled. Found by Nicolas Iooss
using AFL against ssh_config. ok deraadt@ millert@
----------------------------
revision 1.12
date: 2013/11/29 19:00:51;  author: deraadt;  state: Exp;  lines: +6 -5;
fairly simple unsigned char casts for ctype
ok krw
----------------------------
revision 1.11
date: 2012/11/12 14:07:20;  author: halex;  state: Exp;  lines: +4 -2;
make scan_scaled set errno to EINVAL rather than ERANGE if it encounters
an invalid multiplier, like the man page says it should

"looks sensible" deraadt@, ok ian@
----------------------------
revision 1.10
date: 2009/06/20 15:00:04;  author: martynas;  state: Exp;  lines: +4 -4;
use llabs instead of the home-grown version;  and some comment changes
ok ian@, millert@
----------------------------
2017-03-12 10:48:14 +11:00
Damien Miller a7058ec7c0 - (djm) [configure.ac mux.c sftp.c openbsd-compat/Makefile.in]
[openbsd-compat/fmt_scaled.c openbsd-compat/openbsd-compat.h]
   Fix compilation on Linux, including pulling in fmt_scaled(3)
   implementation from OpenBSD's libutil.
2008-05-20 08:57:06 +10:00