GitHub user changkun opened a pull request:
https://github.com/apache/guacamole-server/pull/183
GUACAMOLE-620: Fix instruction loss when buffer is too short
`guac_parser_read` moves `unparsed_end` and `unparsed_start` to the middle
of `parser->__instructionbuf` after `GUAC_PARSE_COMPLETE` state, and so on.
They will be reset only if `unparsed_end == buffer_end`.
This PR fixes an instruction parse error when a provided buffer to `read`
call is shorter than the expected instruction data, then the next
`guac_parser_append` will read incomplete instruction, which leads a
`GUAC_PARSE_ERROR`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/changkun/guacamole-server jira/620
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/guacamole-server/pull/183.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #183
----
commit 2c08cee70e5486a164aa5cf130af4938ad906bc9
Author: Ou Changkun <hi@...>
Date: 2018-09-10T17:41:35Z
GUACAMOLE-620: fix instruction loss when buffer is too short
----
---