Skip to content

Commit 60c9452

Browse files
committed
Fix vds allocation
with `vds := make([]volumeDescriptor, 2)` we have slice with two nil values, to which we later append `vds = append(vds, vd)`, so PVD ends up to be third element with svds appended after it. Specs said there could be up to 127 SVDs, so, let's allocate 0 elements with capacity 128: PVD + 127 SVDs.
1 parent 414258f commit 60c9452

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

filesystem/iso9660/iso9660.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func Read(b backend.Storage, size, start, blocksize int64) (*FileSystem, error)
160160
// we do not do anything with the system area for now
161161

162162
// next read the volume descriptors, one at a time, until we hit the terminator
163-
vds := make([]volumeDescriptor, 2)
163+
vds := make([]volumeDescriptor, 0, 128)
164164
terminated := false
165165
var (
166166
pvd *primaryVolumeDescriptor

0 commit comments

Comments
 (0)