diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-11-27 01:24:19 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-27 01:24:19 +0000 |
commit | 38a00b7cdbd1d3f0b3fe49157e402b32f5c989e8 (patch) | |
tree | 77f345a96203bbf5d5b59253de7f846c29a8a028 /runsc/fsgofer | |
parent | 995c757ec44a675037447793d86f1ac9043afa0c (diff) | |
parent | 4a620c436dabbb0d5036e137bfdd44b945e3cff0 (diff) |
Merge release-20191114.0-38-g4a620c4 (automated)
Diffstat (limited to 'runsc/fsgofer')
-rw-r--r-- | runsc/fsgofer/fsgofer.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go index 9117d9616..c9add64ec 100644 --- a/runsc/fsgofer/fsgofer.go +++ b/runsc/fsgofer/fsgofer.go @@ -956,14 +956,14 @@ func (l *localFile) Readdir(offset uint64, count uint32) ([]p9.Dirent, error) { } func (l *localFile) readDirent(f int, offset uint64, count uint32, skip uint64) ([]p9.Dirent, error) { + var dirents []p9.Dirent + // Limit 'count' to cap the slice size that is returned. const maxCount = 100000 if count > maxCount { count = maxCount } - dirents := make([]p9.Dirent, 0, count) - // Pre-allocate buffers that will be reused to get partial results. direntsBuf := make([]byte, 8192) names := make([]string, 0, 100) |