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 2c12d50 commit 12bcd55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ https://github.com/elastic/beats/compare/v5.6.8...5.6[Check the HEAD diff]
- Fix corruption when parsing repeated headers in an HTTP request or response. {pull}6325[6325]
- 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 12bcd55

Please sign in to comment.