mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:49:09 +02:00
Avoid read past buffer end for empty source when checking for utf-8 signature
This commit is contained in:
parent
8e7572faba
commit
aaf356ba9f
@ -3721,7 +3721,8 @@ type
|
|||||||
begin
|
begin
|
||||||
c:=inputpointer^;
|
c:=inputpointer^;
|
||||||
{ eat utf-8 signature? }
|
{ eat utf-8 signature? }
|
||||||
if (ord(inputpointer^)=$ef) and
|
if (bufsize>2) and
|
||||||
|
(ord(inputpointer^)=$ef) and
|
||||||
(ord((inputpointer+1)^)=$bb) and
|
(ord((inputpointer+1)^)=$bb) and
|
||||||
(ord((inputpointer+2)^)=$bf) then
|
(ord((inputpointer+2)^)=$bf) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user