Date: Wed, 23 Mar 2011 22:08:01 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/lib/libutil humanize_number.c Message-ID: <201103232208.p2NM8C43045955@repoman.freebsd.org>
index | next in thread | raw e-mail
delphij 2011-03-23 22:08:01 UTC
FreeBSD src repository
Modified files:
lib/libutil humanize_number.c
Log:
SVN rev 219939 on 2011-03-23 22:08:01Z by delphij
humanize_number(3) multiply the input number by 100, which could cause an
integer overflow when the input is very large (for example, 100 Pi would
become about 10 Ei which exceeded signed int64_t).
Solve this issue by splitting the division into two parts and avoid the
multiplication.
PR: bin/146205
Reviewed by: arundel
MFC after: 1 month
Revision Changes Path
1.5 +24 -16 src/lib/libutil/humanize_number.c
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103232208.p2NM8C43045955>
