Skip to content

Commit

Permalink
fixed long-standing potential GPF in UpperCopy255BufPas
Browse files Browse the repository at this point in the history
as revealed by synopse/SynPDF#56
  • Loading branch information
Arnaud Bouchez committed Apr 11, 2022
1 parent 1ce7786 commit 89bb41b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SynCommons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33844,14 +33844,14 @@ function UpperCopy255BufPas(dest: PAnsiChar; source: PUTF8Char; sourceLen: PtrIn
_80 := PtrUInt($8080808080808080); // use registers for constants
_61 := $6161616161616161;
_7b := $7b7b7b7b7b7b7b7b;
for i := 0 to sourceLen shr 3 do begin
for i := 0 to (sourceLen-1) shr 3 do begin
c := PPtrUIntArray(source)^[i];
d := c or _80;
PPtrUIntArray(dest)^[i] := c-((d-PtrUInt(_61)) and not(d-_7b)) and
((not c) and _80)shr 2;
end;
{$else} // unbranched uppercase conversion of 4 chars blocks
for i := 0 to sourceLen shr 2 do begin
for i := 0 to (sourceLen-1) shr 2 do begin
c := PPtrUIntArray(source)^[i];
d := c or PtrUInt($80808080);
PPtrUIntArray(dest)^[i] := c-((d-PtrUInt($61616161)) and not(d-PtrUInt($7b7b7b7b))) and
Expand Down
2 changes: 1 addition & 1 deletion SynopseCommit.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'1.18.6374'
'1.18.6375'

0 comments on commit 89bb41b

Please sign in to comment.