Skip to content

Commit 4c805f9

Browse files
lachlancoopermumoshu
authored andcommitted
Check for errors after scanner.Scan() (#140)
The scanner has a fixed buffer size of 1MB. If this is exceeded scanning will fail silently, leading to misleading diff output.
1 parent 065f9eb commit 4c805f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

manifest/parse.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ func Parse(manifest string, defaultNamespace string) map[string]*MappingResult {
115115
}
116116
}
117117
}
118+
if err := scanner.Err(); err != nil {
119+
log.Fatalf("Error reading input: %s", err)
120+
}
118121
return result
119122
}
120123

0 commit comments

Comments
 (0)