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.
  • Loading branch information
tsg authored Oct 29, 2017
1 parent 6df850c commit aeca657
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
*Packetbeat*

- Fix http status phrase parsing not allow spaces. {pull}5312[5312]
- Fix missing length check in the PostgreSQL module. {pull}5457[5457]

*Winlogbeat*

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 aeca657

Please sign in to comment.