Commit Graph

8 Commits

Author SHA1 Message Date
Darren Tucker 2893c5e764 Resync fmt_scaled. with OpenBSD.
Fixes underflow reported in bz#3401.
2022-03-11 18:43:58 +11:00
Damien Miller 32e4e94e15 sync fmt_scaled.c
revision 1.17
date: 2018/05/14 04:39:04;  author: djm;  state: Exp;  lines: +5 -2;
commitid: 53zY8GjViUBnWo8Z;
constrain fractional part to [0-9] (less confusing to static analysis); ok ian@
2018-05-14 14:40:08 +10:00
Damien Miller 10479cc2a4 Many typo fixes from Karsten Weiss
Spotted using https://github.com/lucasdemarchi/codespell
2018-04-10 10:19:02 +10:00
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