From adf13c61233a61c93440b4116ace5e13324ac36c Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 31 Jan 2011 10:19:37 -0800 Subject: [PATCH] go blobserver: fix crash if short blobrefs requested. --- server/go/blobserver/localdisk.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/go/blobserver/localdisk.go b/server/go/blobserver/localdisk.go index 645352929..0de7f92d6 100644 --- a/server/go/blobserver/localdisk.go +++ b/server/go/blobserver/localdisk.go @@ -52,6 +52,9 @@ func BlobFileBaseName(b *blobref.BlobRef) string { func BlobDirectoryName(b *blobref.BlobRef) string { d := b.Digest() + if len(d) < 6 { + d = d + "______" + } return fmt.Sprintf("%s/%s/%s/%s", *flagStorageRoot, b.HashName(), d[0:3], d[3:6]) }