Skip to content

Commit 96be288

Browse files
committed
Don't allow zero-length blobs in lookaside cache (#9304)
1 parent 47995b3 commit 96be288

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

enterprise/server/backends/distributed/distributed.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ func (c *Cache) addLookasideEntry(r *rspb.ResourceName, data []byte) {
363363
if r.GetDigest().GetSizeBytes() > *maxLookasideEntryBytes {
364364
return
365365
}
366+
if len(data) == 0 {
367+
c.log.Infof("Attempted to set zero-length lookaside entry. Key %q", r)
368+
return
369+
}
366370
k, ok := lookasideKey(r)
367371
if !ok {
368372
c.log.Debugf("Not setting lookaside entry for resource: %s", r)

0 commit comments

Comments
 (0)