-
Notifications
You must be signed in to change notification settings - Fork 64
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
stack overflow in TIdModBusClient.SendCommand #30
Comments
Yes, using The current behaviour is going to be the same when the reply is too long but will now raise a range check error ( Please let me know if I should submit a pull request. |
TBitConverter isn't available in D2007 but I agree that it is better an error is returned.
Then at least an exception is raised if the buffer is an invalid size. |
Yes, but this alone is not going to solve your problem when there is too much data (when (Having to support environments older than a decade is such a bane for Delphi code.) |
Would the |
No: |
Hi,
We ran into a issue (using Indy10, Delphi 2007) where our application was crashing to desktop and discovered there can be an overflow in
IdModbusClient
Move(RecBuffer[0], ReceiveBuffer, iSize)
if the server responds with too much data on the input buffer since MBPData is a fixed size but the client doesn't check if the amount of data returned will fit into the recievebuffer.
For my purposes I've added a simple size check and thrown away the rest of the buffer in that cycle and that's stopped the overflow (and random CTD) here.
The text was updated successfully, but these errors were encountered: