Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Fix panic when the prefix is > 61 chars #182

Merged
merged 1 commit into from
Feb 26, 2016
Merged

Fix panic when the prefix is > 61 chars #182

merged 1 commit into from
Feb 26, 2016

Conversation

blalor
Copy link
Contributor

@blalor blalor commented Feb 25, 2016

The bar function subtracts 2 from the barSize; if barSize is < 2, drawing the progress bar will panic because you can't string.Repeat a negative length.

Running: [/src/config.sh]
meta tag not found on XX.XXXXXXXXX.XXX/XXX-XXX/XXXX/XXXXXXX-XXXX-XXXXXXX: expected a 200 OK got 403
panic: runtime error: makeslice: len out of range

goroutine 1 [running]:
strings.Repeat(0x857ee0, 0x1, 0xfffffffffffffffe, 0x0, 0x0)
    /usr/lib/golang/src/strings/strings.go:458 +0x68
github.com/appc/acbuild/Godeps/_workspace/src/github.com/coreos/ioprogress.func·004(0x0, 0x37ae506, 0x0, 0x0)
    /root/acbuild/gopath/src/github.com/appc/acbuild/Godeps/_workspace/src/github.com/coreos/ioprogress/draw.go:112 +0x270
github.com/appc/acbuild/registry.func·002(0x0, 0x37ae506, 0x0, 0x0)
    /root/acbuild/gopath/src/github.com/appc/acbuild/registry/fetch.go:431 +0x1e7

the `bar` function subtracts 2 from the barSize; if barSize is < 2,
drawing the progress bar will panic because you can't `string.Repeat`
a negative length.
@cgonyeo
Copy link
Member

cgonyeo commented Feb 25, 2016

Nice catch. I'll want to ultimately fix this in ioprogress, but might as well take care of it here until that happens.

cgonyeo pushed a commit that referenced this pull request Feb 26, 2016
Fix panic when the prefix is > 61 chars
@cgonyeo cgonyeo merged commit 1bf95ab into containers:master Feb 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants