Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Integer overflow in cafe http stream #944

Open
requilence opened this issue Nov 29, 2019 · 0 comments
Open

Integer overflow in cafe http stream #944

requilence opened this issue Nov 29, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@requilence
Copy link
Contributor

requilence commented Nov 29, 2019

Describe the bug
When a cafe tries to send the payload larger than uint16(65535) length, it overflows the size bytes here. As a result, a client is got unexpected EOF when trying to unmarshal into pb.Envelope here

To Reproduce

  1. Create a lot of peers for an account
  2. Do SearchContacts, providing this account's address

Expected behavior
Got accounts as usual

I'm not sure what is a good way to fix this while preserving backward compatibility.
Here is what I have in mind

  • increase the length of size bytes to 4, but only for textile user agents higher than X version
  • add an extra param to the query with the length of size bytes prefix. Use 2 by default

Let me know what do you think do so I can provide PR

@requilence requilence added the bug Something isn't working label Nov 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant