Skip to content

Commit

Permalink
Fix minor panic in http parser (#6750)
Browse files Browse the repository at this point in the history
There was a bounds check error in parsing HTTP responses. A malformed
response line in the form "HTTP/1.1\r\n" would cause a panic when parsed.

Related to #6409
  • Loading branch information
adriansr authored and andrewkroh committed Apr 6, 2018
1 parent 16f7e3a commit 6db64c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ https://github.com/elastic/beats/compare/v6.0.1...v6.1.0[View commits]
- Fix panic when parsing partial AMQP messages. {pull}6384[6384]
- Fix out of bounds access to slice in MongoDB parser. {pull}6256[6256]
- Fix sniffer hanging on exit under Linux. {pull}6535[6535]
- Fix bounds check error in http parser causing a panic. {pull}6750[6750]
*Winlogbeat*
Expand Down
2 changes: 1 addition & 1 deletion packetbeat/protos/http/http_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (*parser) parseHTTPLine(s *stream, m *message) (cont, ok, complete bool) {
var version []byte
var err error
fline := s.data[s.parseOffset:i]
if len(fline) < 8 {
if len(fline) < 9 {
if isDebug {
debugf("First line too small")
}
Expand Down

0 comments on commit 6db64c6

Please sign in to comment.