mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-17 02:20:37 +01:00
+ Fix of invalid pointer bug in unescape, from U. Maeder
This commit is contained in:
parent
e240d78c2e
commit
2d7dd81998
@ -332,14 +332,17 @@ begin
|
|||||||
halt;
|
halt;
|
||||||
end;
|
end;
|
||||||
sptr :=0;
|
sptr :=0;
|
||||||
for cnt := 0 to qslen do
|
|
||||||
|
{ for cnt := 0 to qslen do +++++ use while instead of for }
|
||||||
|
cnt:=0;
|
||||||
|
while cnt<=qslen do
|
||||||
begin
|
begin
|
||||||
case querystring[cnt] of
|
case querystring[cnt] of
|
||||||
'+': qunescaped[sptr] := ' ';
|
'+': qunescaped[sptr] := ' ';
|
||||||
'%': begin
|
'%': begin
|
||||||
qunescaped[sptr] :=
|
qunescaped[sptr] :=
|
||||||
hexconv(querystring[cnt+1], querystring[cnt+2]);
|
hexconv(querystring[cnt+1], querystring[cnt+2]);
|
||||||
inc(cnt,2);
|
inc(cnt,2); { <--- not allowed in for loops in pascal }
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
qunescaped[sptr] := querystring[cnt];
|
qunescaped[sptr] := querystring[cnt];
|
||||||
@ -347,6 +350,7 @@ begin
|
|||||||
inc(sptr);
|
inc(sptr);
|
||||||
{ skelet fix }
|
{ skelet fix }
|
||||||
qunescaped[sptr]:=#0;
|
qunescaped[sptr]:=#0;
|
||||||
|
inc(cnt); { <-- don't forget to increment }
|
||||||
end;
|
end;
|
||||||
UnEscape:=qunescaped;
|
UnEscape:=qunescaped;
|
||||||
end;
|
end;
|
||||||
@ -482,7 +486,10 @@ end.
|
|||||||
{
|
{
|
||||||
HISTORY
|
HISTORY
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.7 2002-10-10 05:48:20 michael
|
Revision 1.8 2002-10-18 05:43:53 michael
|
||||||
|
+ Fix of invalid pointer bug in unescape, from U. Maeder
|
||||||
|
|
||||||
|
Revision 1.7 2002/10/10 05:48:20 michael
|
||||||
Added http_remote and fixed determining of input method. Fix courtesy of Antal <antal@carmelcomputer.com>
|
Added http_remote and fixed determining of input method. Fix courtesy of Antal <antal@carmelcomputer.com>
|
||||||
|
|
||||||
Revision 1.6 2002/09/12 16:24:59 michael
|
Revision 1.6 2002/09/12 16:24:59 michael
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user