1
0
mirror of https://github.com/p2r3/bareiron.git synced 2025-10-01 23:25:09 +02:00

implement recv_buffer size limit and input validation

* Implement recv_buffer size limit and input validation

* Add readLengthPrefixedData helper and refactor some read flows

* Change error to be more accurate

* Add newline to error message

* fix long chat messages kicking clients

* style nitpicks

---------

Co-authored-by: p2r3 <p2r3@p2r3.com>
Co-authored-by: p2r3 <41925384+p2r3@users.noreply.github.com>
This commit is contained in:
Tyler Zars
2025-09-18 19:00:02 -04:00
committed by GitHub
parent b23e19ecd4
commit 3bde692976
5 changed files with 47 additions and 18 deletions

View File

@@ -32,7 +32,9 @@ int64_t readInt64 (int client_fd);
float readFloat (int client_fd);
double readDouble (int client_fd);
ssize_t readLengthPrefixedData (int client_fd);
void readString (int client_fd);
void readStringN (int client_fd, uint32_t max_length);
uint32_t fast_rand ();
uint64_t splitmix64 (uint64_t state);