mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 08:12:09 +02:00
* fixed buffer overflow in delete() for widestrings (patch by
Martin Schreiber, #10800) git-svn-id: trunk@10255 -
This commit is contained in:
parent
71a017aca0
commit
4d9445749c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7966,6 +7966,7 @@ tests/webtbs/tw10753.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10753a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10757.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10790.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10800.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1081.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1090.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1092.pp svneol=native#text/plain
|
||||
|
@ -1362,7 +1362,7 @@ begin
|
||||
if Index+Size<=LS then
|
||||
begin
|
||||
Dec(Index);
|
||||
Move(PWideChar(S)[Index+Size],PWideChar(S)[Index],(LS-Index+1)*sizeof(WideChar));
|
||||
Move(PWideChar(S)[Index+Size],PWideChar(S)[Index],(LS-Index-Size+1)*sizeof(WideChar));
|
||||
end;
|
||||
Setlength(s,LS-Size);
|
||||
end;
|
||||
|
13
tests/webtbs/tw10800.pp
Normal file
13
tests/webtbs/tw10800.pp
Normal file
@ -0,0 +1,13 @@
|
||||
program widestringdelete;
|
||||
{$ifdef FPC}{$mode objfpc}{$h+}{$INTERFACES CORBA}{$endif}
|
||||
{$ifdef mswindows}{$apptype console}{$endif}
|
||||
uses
|
||||
{$ifdef FPC}{$ifdef unix}cthreads,{$endif}{$endif}
|
||||
sysutils;
|
||||
var
|
||||
wstr1: widestring;
|
||||
begin
|
||||
setlength(wstr1,10240);
|
||||
delete(wstr1,1,10230);
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user