Change in osmo-remsim[master]: server: Don't accept out-of-range bank/client/slot numbers on REST

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Feb 21 20:08:00 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/17241 )

Change subject: server: Don't accept out-of-range bank/client/slot numbers on REST
......................................................................

server: Don't accept out-of-range bank/client/slot numbers on REST

Change-Id: Id0c9dcda58d1f85df431a74bbfba06cfaa0af69d
---
M src/server/rest_api.c
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index abd46b9..ff1b588 100644
--- a/src/server/rest_api.c
+++ b/src/server/rest_api.c
@@ -86,6 +86,8 @@
 		return -EINVAL;
 	bslot->bank_id = json_integer_value(jbank_id);
 	bslot->slot_nr = json_integer_value(jslot_nr);
+	if (bslot->bank_id > 1023 || bslot->slot_nr > 1023)
+		return -EINVAL;
 	return 0;
 }
 
@@ -110,6 +112,8 @@
 		return -EINVAL;
 	cslot->client_id = json_integer_value(jclient_id);
 	cslot->slot_nr = json_integer_value(jslot_nr);
+	if (cslot->client_id > 1023 || cslot->slot_nr > 1023)
+		return -EINVAL;
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/17241
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: Id0c9dcda58d1f85df431a74bbfba06cfaa0af69d
Gerrit-Change-Number: 17241
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200221/d7f53964/attachment.htm>


More information about the gerrit-log mailing list