GitHub user dhull opened a pull request:
https://github.com/apache/thrift/pull/1316
THRIFT-4266: Erlang skip fix
The Erlang library has a bug that causes it to crash when attempting to
skip over a struct that it receives that does not exist in its thrift
definition. This will happen when the client and server are using different
versions of the thrift definition where one of the versions adds a struct field
to an existing struct.
This pull request has two commits. The first commit adds a test that fails
with the existing Erlang library. The second commit fixes the bug.
The bug was that the `erlang_protocol:skip` function expects an atom as its
second (Type) argument, but the calls in `skip_struct_loop`, `skip_map_loop`,
`skip_set_loop`, and `skip_list_loop` did not convert from the integer type
decoded from the buffer to the corresponding atom.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dhull/thrift thrift-4266-erlang-skip-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/1316.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 #1316
----
commit 79874dbe079fbabba663568e5ed31ffab540329a
Author: David Hull <[email protected]>
Date: 2017-07-26T21:27:02Z
THRIFT-4266: Fix skipping of unknown fields in Erlang client.
commit 8fd55cc7685ea2ea22016296936789572dd83c56
Author: David Hull <[email protected]>
Date: 2017-07-27T00:15:00Z
THRIFT-4266: Add Erlang deleted field test.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---