mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 10:29:21 +02:00
* Avoid index out of bounds error
This commit is contained in:
parent
3cf7890352
commit
ddf0774575
@ -855,13 +855,18 @@ begin
|
||||
begin
|
||||
Def:=ParamDefs[i];
|
||||
if I>=ParamArray.Count then
|
||||
begin
|
||||
if ParamDefs[i].Required then
|
||||
JSONRPCParamError(SErrParamsRequiredParamNotFound,[def.Name]);
|
||||
end
|
||||
else
|
||||
begin
|
||||
Param:=ParamArray[i];
|
||||
// jtUnkown accepts all data types
|
||||
if (def.DataType<>jtUnknown) and not (Param.JSONType=def.DataType) then
|
||||
JSONRPCParamError(SErrParamsDataTypeMismatch,[def.Name,JSONTypeName(def.DataType),JSONTypeName(Param.JSONType)]);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomJSONRPCHandler.DoExecute(Const Params: TJSONData;AContext : TJSONRPCCallContext): TJSONData;
|
||||
|
Loading…
Reference in New Issue
Block a user