Skip to content

Commit

Permalink
[Packetbeat] Fix SIP parser logic related to line length check (elast…
Browse files Browse the repository at this point in the history
…ic#23411)

* Since we're getting chars up to the start of CRLF, not the end

* Updated as suggested by andrewkroh

* Packetbeat bugfix - Fix SIP parser logic related to line length check

* Update SIP golden files to include 200 OK messages

Co-authored-by: Marc Guasch <marc.guasch@elastic.co>
  • Loading branch information
ljw- and marc-gr committed Jan 14, 2021
1 parent 68a5daa commit 5ac09a1
Show file tree
Hide file tree
Showing 4 changed files with 455 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d

*Packetbeat*

- Fix SIP parser logic related to line length check. {pull}23411[23411]


*Winlogbeat*

Expand Down
3 changes: 2 additions & 1 deletion packetbeat/protos/sip/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ func (*parser) parseSIPLine(pi *parsingInfo, m *message) error {
err error
)

const minStatusLineLength = len("SIP/2.0 XXX OK")
fline := pi.data[pi.parseOffset:i]
if len(fline) < 16 { // minimum line will be "SIP/2.0 XXX OK\r\n"
if len(fline) < minStatusLineLength {
if isDebug {
debugf("First line too small")
}
Expand Down
Loading

0 comments on commit 5ac09a1

Please sign in to comment.