]> git.saurik.com Git - apple/libutil.git/commitdiff
libutil-47.tar.gz macos-1012 os-x-1012 v47
authorApple <opensource@apple.com>
Fri, 4 Mar 2016 05:57:33 +0000 (05:57 +0000)
committerApple <opensource@apple.com>
Fri, 4 Mar 2016 05:57:33 +0000 (05:57 +0000)
humanize_number.c

index b773422475b39b67530bdeca11f8ab645df28bf5..cf0cfc810d3dfc87614952cf3141b4a1e6bf0daf 100644 (file)
@@ -133,7 +133,7 @@ humanize_number(char *buf, size_t len, int64_t quotient,
 
        if (scale & (HN_AUTOSCALE | HN_GETSCALE)) {
                /* See if there is additional columns can be used. */
-               for (max = 1, i = len - baselen; i-- > 0;)
+               for (max = 1, i = len - baselen; i-- > 0 && max <= (INT64_MAX / 10);)
                        max *= 10;
 
                /*