mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 11:50:19 +02:00
* Avoid possible AV when the string-index is larger then the string-length
git-svn-id: trunk@16536 -
This commit is contained in:
parent
deece746a3
commit
af2ef60a29
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user