Merge pull request #9064 from recursive-madman/patch-1

Proposed fix for #8979
This commit is contained in:
Jessie Frazelle 2014-11-13 12:24:22 -08:00
commit 06899e0810
1 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,10 @@ func LoadImage(root string) (*Image, error) {
// because a layer size of 0 (zero) is valid
img.Size = -1
} else {
size, err := strconv.Atoi(string(buf))
// Using Atoi here instead would temporarily convert the size to a machine
// dependent integer type, which causes images larger than 2^31 bytes to
// display negative sizes on 32-bit machines:
size, err := strconv.ParseInt(string(buf), 10, 64)
if err != nil {
return nil, err
}