-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pgtype.parseHstore: Reject invalid input; Fix error messages
The parseHstore function did not check the return value from p.Consume() after a ', ' sequence. It expects a doublequote '"' that starts the next key, but would accept any character. This means it accepted invalid input such as: "key1"=>"b", ,key2"=>"value" Add a unit test that covers this case Fix a couple of the nearby error strings while looking at this. Found by looking at staticcheck warnings: pgtype/hstore.go:434:6: this value of end is never used (SA4006) pgtype/hstore.go:434:6: this value of r is never used (SA4006)
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters