Skip to content

Commit

Permalink
Fix missing length check in PgSQL (elastic#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 a1f7193 commit 3ef09d1
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 @@ -36,6 +36,8 @@ https://github.com/elastic/beats/compare/v5.6.3...5.6[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 @@ -379,6 +379,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 3ef09d1

Please sign in to comment.