File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -281,24 +281,12 @@ func (c Checker) linesChanged() map[string][]pos {
281
281
282
282
scanner := bufio .NewReader (c .Patch )
283
283
var scanErr error
284
- Loop:
285
284
for {
286
285
lineB , isPrefix , err := scanner .ReadLine ()
287
286
if isPrefix {
288
- // If a single line overflowed the buffer, keep building it up. This
289
- // leaves the possibility of a DOS attack by a user creating a git commit
290
- // with a line so large it OOMs the process calling golangci-lint.
291
- for {
292
- lineB2 , isPrefix2 , err2 := scanner .ReadLine ()
293
- if err2 != nil {
294
- scanErr = err2
295
- break Loop
296
- }
297
- lineB = append (lineB , lineB2 ... )
298
- if isPrefix2 {
299
- continue
300
- }
301
- }
287
+ // If a single line overflowed the buffer, don't bother processing it as
288
+ // it's likey part of a file and not relevant to the patch.
289
+ continue
302
290
}
303
291
if err != nil {
304
292
scanErr = err
You can’t perform that action at this time.
0 commit comments