Skip to content

Commit

Permalink
Fix missing length check in PgSQL (#5457)
Browse files Browse the repository at this point in the history
There was a length check missing.

(cherry picked from commit aeca657)
  • Loading branch information
tsg committed Oct 30, 2017
1 parent 61f3822 commit c91abca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ https://github.com/elastic/beats/compare/v6.0.0-rc2...master[Check the HEAD diff

*Packetbeat*

- Fix missing length check in the PostgreSQL module. {pull}5457[5457]

*Winlogbeat*

==== Added
Expand Down
3 changes: 3 additions & 0 deletions packetbeat/protos/pgsql/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ func pgsqlFieldsParser(s *pgsqlStream, buf []byte) error {
off += 4

// read format (int16)
if len(buf) < off+2 {
return errFieldBufferShort
}
format := common.BytesNtohs(buf[off : off+2])
off += 2
fieldsFormat = append(fieldsFormat, byte(format))
Expand Down

0 comments on commit c91abca

Please sign in to comment.