* Avoid possible AV when the string-index is larger then the string-length

git-svn-id: trunk@16536 -
This commit is contained in:
joost 2010-12-10 15:32:34 +00:00
parent deece746a3
commit af2ef60a29

View File

@ -254,6 +254,13 @@ var
pc : pchar;
x:integer;
begin
if Offset>length(S) then
begin
Result := False;
MatchPos := 0;
Exit;
end;
{if the regex string hasn't been parsed yet, do so}
if (FStateCount = 0) then begin
if not Parse(ErrorPos, ErrorCode) then