[ 
https://issues.apache.org/jira/browse/THRIFT-4266?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16103562#comment-16103562
 ] 

ASF GitHub Bot commented on THRIFT-4266:
----------------------------------------

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.

----


> Erlang library throws during skipping fields of composite type (maps, lists, 
> structs, sets)
> -------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-4266
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4266
>             Project: Thrift
>          Issue Type: Bug
>          Components: Erlang - Library
>    Affects Versions: 0.10.0
>            Reporter: David Hull
>
> I am creating this issue because I am unable to reopen THRIFT-1191.
> The Erlang thrift library throws an error when it attempts skip over an 
> unknown field when decoding a message.
> The issue is that the second argument of the `thrift_protocol:skip` function 
> must be an atom, but the calls to the `skip` function in `skip_struct_loop`, 
> skip_map_loop`, skip_set_loop`, and `skip_list_loop` do not convert the type 
> of the received field header from the integer form to the atom form.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to