-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
harden pgsql parser #825
harden pgsql parser #825
Conversation
also fix off-by one error in comparison leading up to panic when accessing buffer |
LGTM |
logp.Critical("Pgsql invalid parser state") | ||
} | ||
|
||
detailedf("parseMessage return: ok=%v, complete=%v, off=%v", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend for parseMessage
to be pgsqlMessageParser
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually no. it was for wrapping the switch statements, but I see what you mean. Will update the output.
LGTM |
Split parser loop in more fine-grained parser functions
- Harden pgsql parser - check pgsql strings really end with \0 - check pgsql message type - limit data row/column/fields parsing buffer regarding to length field - check row/column/fields parser consumed exactly `length` bytes - do not skip some parsing errors, but report to kill stream
4ef40c4
to
b5e25ad
Compare
Resolves #565
length
bytes