Skip to content

Fix buffer overrun in ThreadedSocketConnection partial sends - #742

Open
PauloHMattos wants to merge 1 commit into
quickfix:masterfrom
PauloHMattos:fix/threaded-connection-send-oob-read
Open

Fix buffer overrun in ThreadedSocketConnection partial sends#742
PauloHMattos wants to merge 1 commit into
quickfix:masterfrom
PauloHMattos:fix/threaded-connection-send-oob-read

Conversation

@PauloHMattos

Copy link
Copy Markdown

The send method in ThreadedSocketConnection incorrectly passed the total message length to socket_send on every iteration of the loop. In the event of a partial send, advancing the buffer pointer while keeping the size argument as the total message length caused the socket to read past the end of the allocated string buffer.

Updated the socket_send size argument to calculate the remaining length (msg.length() - totalSent).

The `send` method in `ThreadedSocketConnection` incorrectly passed the 
total message length to `socket_send` on every iteration of the loop. 
In the event of a partial send, advancing the buffer pointer while 
keeping the size argument as the total message length caused the socket 
to read past the end of the allocated string buffer. 

Updated the `socket_send` size argument to calculate the remaining 
length (`msg.length() - totalSent`).
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

Successfully merging this pull request may close these issues.

1 participant