Skip to content
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

values of type "[][]byte" are lost when marshalling #286

Open
rickyyangz opened this issue Sep 8, 2019 · 2 comments
Open

values of type "[][]byte" are lost when marshalling #286

rickyyangz opened this issue Sep 8, 2019 · 2 comments

Comments

@rickyyangz
Copy link
Contributor

The latest PR (#283) introduced a bug that as the title described. So multidimensional byte slices/arrays will be marshalled to empty bytes.

I wrote a testcase

func TestMultidimensionalByteSlice(t *testing.T) {
    arr := [2][2]byte{
        [2]byte{1, 2},
        [2]byte{3, 4}}

    bz, err := cdc.MarshalBinaryBare(arr)
    assert.NoError(t, err)
    t.Log(bz)
    var a [][]byte
    cdc.UnmarshalBinaryBare(bz,&a)
    t.Log(a)
}

the result is

=== RUN   TestMultidimensionalByteSlice
--- PASS: TestMultidimensionalByteSlice (0.00s)
    proto3_compat_test.go:136: [10]
    proto3_compat_test.go:139: []
PASS

BTW, I submitted a report to the hackerone bug bounty program, but the response is not very timely, So I create an issue here.

@zmanian
Copy link
Contributor

zmanian commented Sep 12, 2019

This bug doesn't appear to have any security implications so would be out of scope for the hackerone bug bounty.

I'm looking into if we can potentially do a bug release to fix this while we work on the full protobuf compatibility PRs

@zmanian
Copy link
Contributor

zmanian commented Sep 12, 2019

This test case passes on the latest release v0.15 but does not pass in master. master is work in progress towards more complete protobuf compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants