mirror of https://github.com/sirupsen/logrus.git
Scan text in 64KB chunks
This commit fixes a potential denial of service vulnerability in logrus.Writer() that could be triggered by logging text longer than 64KB without newlines. Previously, the bufio.Scanner used by Writer() would hang indefinitely when reading such text without newlines, causing the application to become unresponsive.
This commit is contained in:
parent
766cfece37
commit
c052ba6a07
|
@ -75,7 +75,8 @@ func (entry *Entry) writerScanner(reader *io.PipeReader, printFunc func(args ...
|
||||||
if len(data) > chunkSize {
|
if len(data) > chunkSize {
|
||||||
return chunkSize, data[:chunkSize], nil
|
return chunkSize, data[:chunkSize], nil
|
||||||
}
|
}
|
||||||
return 0, nil, nil
|
|
||||||
|
return len(data), data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Use the custom split function to split the input
|
//Use the custom split function to split the input
|
||||||
|
|
Loading…
Reference in New Issue