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

Bug: Example code does not check connection array size #442

Open
jonashoechst opened this issue Feb 26, 2021 · 0 comments
Open

Bug: Example code does not check connection array size #442

jonashoechst opened this issue Feb 26, 2021 · 0 comments

Comments

@jonashoechst
Copy link

Thank you for the great QUIC implementation! We might have found a bug, though it's only affecting the echo example. The server code crashed in the case if more than 256 connections are handled.

Details: The conns array holds active connections for the instance and is defined by a fixed length:

quicly_conn_t *conns[256] = {client}; /* a null-terminated list of connections; proper app should use a hashmap or something */

In process_msg new connections are accepted and added to the respective list, but the length of this list is not checked:

quicly/examples/echo.c

Lines 176 to 179 in a9498b4

} else if (!is_client) {
/* assume that the packet is a new connection */
quicly_accept(conns + i, &ctx, NULL, msg->msg_name, &decoded, NULL, &next_cid, NULL);
}

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

1 participant