Date: Fri, 22 Apr 2011 00:32:16 +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: <201104220032.p3M0WZ5E000200@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
delphij 2011-04-22 00:32:16 UTC
FreeBSD src repository
Modified files: (Branch: RELENG_7)
lib/libutil humanize_number.c
Log:
SVN rev 220934 on 2011-04-22 00:32:16Z by delphij
MFC r219939:
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
Revision Changes Path
1.2.10.2 +24 -16 src/lib/libutil/humanize_number.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104220032.p3M0WZ5E000200>
