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

JvMemoryData: Check if Offset overflows before adding to it. #92

Closed

Conversation

Projects
None yet
2 participants
@MHumm
Copy link
Contributor

commented Apr 25, 2019

Proposed fix for Mantis issue 6570.
http://issuetracker.delphi-jedi.org/view.php?id=6570

FieldLen := CalcFieldLen(FieldDefList[I].DataType, FieldDefList[I].Size);
if Offset + FieldLen + 1 <= high(Offset) then
Inc(Offset, FieldLen + 1);
end;

This comment has been minimized.

Copy link
@obones

obones Apr 30, 2019

Member

What happens if the test is False?
Wouldn't it be an error situation that should be reported via an exception?

This comment has been minimized.

Copy link
@MHumm

MHumm Apr 30, 2019

Author Contributor

Yes that would be a good idea. But which one to throw? ERangeError or EIntOverflow?
Most likely EIntOverflow I guess.

@MHumm

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

Superseded by #114

@MHumm MHumm closed this May 1, 2019

@MHumm MHumm deleted the MHumm:Mantis6570_Overflow_in_JvMemoryData branch May 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.