1
0
mirror of https://github.com/golang/go synced 2024-11-05 19:36:10 -07:00
Commit Graph

2 Commits

Author SHA1 Message Date
Mikołaj Baranowski
5f9a541373 internal/fastwalk: avoid slice bounds out of range for long file names
Fixes golang/go#28715

Change-Id: Ibed78d2376f4ec010ee9e5e772069afd14fd5552
Reviewed-on: https://go-review.googlesource.com/c/148884
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-12 23:16:31 +00:00
Yuval Pavel Zholkover
5e66757b83 internal/fastwalk: don't cross Dirent.Reclen boundry while looking for NULL in parseDirEnt
Crossing Dirent.Reclen boundry was manifested in golang/go#28131 as garbaled filenames,
when Dirent.Name was not NULL terminated on FreeBSD due to a bug (parseDirEnt would find a NULL
in the following Dirent's Fileno/Reclen fields).

Only search for NULL on linux, when the Namlen field is available use it directly instead.

Updates golang/go#28131

Change-Id: I64090576c8bad2bd246d1561432bf73d5caee2a9
Reviewed-on: https://go-review.googlesource.com/c/141801
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-10-13 18:20:35 +00:00