mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Update daemon_linux.go for preventing off-by-one
Array length should be bigger than 5, when accessing index 4 Signed-off-by: J-jaeyoung <jjy600901@gmail.com>
This commit is contained in:
parent
9c15e82f19
commit
19eda6b9a2
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ func (daemon *Daemon) cleanupMountsFromReaderByID(reader io.Reader, id string, u
|
|||
regexps := getCleanPatterns(id)
|
||||
sc := bufio.NewScanner(reader)
|
||||
for sc.Scan() {
|
||||
if fields := strings.Fields(sc.Text()); len(fields) >= 4 {
|
||||
if fields := strings.Fields(sc.Text()); len(fields) > 4 {
|
||||
if mnt := fields[4]; strings.HasPrefix(mnt, daemon.root) {
|
||||
for _, p := range regexps {
|
||||
if p.MatchString(mnt) {
|
||||
|
|
Loading…
Add table
Reference in a new issue