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

Range Check Error in TMVCStreamHelper #386

Closed
dipold opened this issue May 19, 2020 · 0 comments
Closed

Range Check Error in TMVCStreamHelper #386

dipold opened this issue May 19, 2020 · 0 comments
Assignees
Labels
accepted Issue has been accepted and inserted in a future milestone
Milestone

Comments

@dipold
Copy link

dipold commented May 19, 2020

Case the Range checking is True in Project Options > Delphi Compiler > Compiling, I am getting Range check error when AString is empty in this code:

Self.WriteBuffer(UFTStr[low(UFTStr)], Length(UFTStr));

I think it would be enough to check if the parameter is empty:

procedure TMVCStreamHelper.WriteUTF8(const AString: string);
var
  UFTStr: UTF8String;
begin
  UFTStr := UTF8String(AString);
  if (UFTStr <> '') then
    Self.WriteBuffer(UFTStr[Low(UFTStr)], Length(UFTStr));
end;
@danieleteti danieleteti self-assigned this May 19, 2020
@danieleteti danieleteti added the accepted Issue has been accepted and inserted in a future milestone label May 19, 2020
@danieleteti danieleteti added this to the 3.2.0-boron milestone May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Issue has been accepted and inserted in a future milestone
Projects
None yet
Development

No branches or pull requests

2 participants