pluginized-protocols / picotcpls

TCPLS implementation using a TLS 1.3 implementation in C (master supports RFC8446 as well as draft-26, -27, -28) -- Published in ACM CoNEXT'21 -- Best Community Award
15 stars 5 forks source link

correct new_list allocation in funtion get_stream_from_socket and cor… #19

Closed akemery closed 3 years ago

akemery commented 4 years ago

In tcpls_receive, when the data are received from a stream, a stream_ptr list related to rcv_socket is got from available stream list using the function get_stream_from_socket, there is a pointer error in that function. Use list_t streams_ptr = new_list(sizeof(tcpls_stream_t ), 3); rather than list_t streams_ptr = new_list(sizeof(tcpls_stream_t ), 3); Also when the stream is retrieved in tcpls_receive() use
tcpls_stream_t
stream = list_get(streams_ptr, i); rather than tcpls_stream_t **stream = list_get(streams_ptr, i);

That remove memory error when trying to send data using stream.

frochet commented 4 years ago

Hello Emery,

Arf, you're not on the most recent commit. This problem has already been fixed in d061dfaf, and you didn't work from the last version (which explains your merge conflict). You should rebase your branch on Master when a new commit is pushed and fix locally any potential conflict before sending a pull request.

There might be other bugs in the code; I expect to hunt them all in August, in the meantime it does not appear safe for you to experiment with the API. You will probably encounter many more other issues. Some of them might be related to some code logic that may change in the future (e.g., detecting a stream id based on AEAD tag mismatch will change).