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 a7e0198 commit abd0237
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ https://github.com/elastic/beats/compare/v6.0.0-rc2...master[Check the HEAD diff

*Packetbeat*

- Fix http status phrase parsing not allow spaces. {pull}5312[5312]
- 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 abd0237

Please sign in to comment.