server: Don't accept out-of-range bank/client/slot numbers on REST
Change-Id: Id0c9dcda58d1f85df431a74bbfba06cfaa0af69d
This commit is contained in:
parent
44866d501b
commit
f43babac56
|
@ -86,6 +86,8 @@ static int json2bank_slot(struct bank_slot *bslot, json_t *in)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
bslot->bank_id = json_integer_value(jbank_id);
|
bslot->bank_id = json_integer_value(jbank_id);
|
||||||
bslot->slot_nr = json_integer_value(jslot_nr);
|
bslot->slot_nr = json_integer_value(jslot_nr);
|
||||||
|
if (bslot->bank_id > 1023 || bslot->slot_nr > 1023)
|
||||||
|
return -EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +112,8 @@ static int json2client_slot(struct client_slot *cslot, json_t *in)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
cslot->client_id = json_integer_value(jclient_id);
|
cslot->client_id = json_integer_value(jclient_id);
|
||||||
cslot->slot_nr = json_integer_value(jslot_nr);
|
cslot->slot_nr = json_integer_value(jslot_nr);
|
||||||
|
if (cslot->client_id > 1023 || cslot->slot_nr > 1023)
|
||||||
|
return -EINVAL;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue