8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 04:03:03 +01:00

Validate input parameters

This commit is contained in:
asfernandes 2007-01-18 00:26:14 +00:00
parent 925f9704b4
commit 87aa10c9cd

View File

@ -2650,11 +2650,39 @@ static void define_procedure( dsql_req* request, NOD_TYPE op)
request->append_uchar(blr_short);
request->append_uchar(0);
if (inputs) {
if (inputs)
{
request->append_uchar(blr_receive);
request->append_uchar(0);
}
request->append_uchar(blr_begin);
if (inputs)
{
parameters = procedure_node->nod_arg[e_prc_inputs];
dsql_nod** ptr = parameters->nod_arg;
for (const dsql_nod* const* const end = ptr + parameters->nod_count;
ptr < end; ptr++)
{
dsql_nod* parameter = *ptr;
dsql_var* variable = (dsql_var*) parameter->nod_arg[e_var_variable];
dsql_fld* field = variable->var_field;
if (field->fld_constrained || field->fld_not_nullable)
{
// ASF: To validate input parameters we need only to read his value.
// Assigning it to null is an easy way to do this.
request->append_uchar(blr_assignment);
request->append_uchar(blr_parameter2);
request->append_uchar(variable->var_msg_number);
request->append_ushort(variable->var_msg_item);
request->append_ushort(variable->var_msg_item + 1);
request->append_uchar(blr_null);
}
}
}
if (outputs)
{
parameters = procedure_node->nod_arg[e_prc_outputs];