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
Thu Feb 20 17:53:48 UTC 2020


laforge has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/41/17241/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200220/0f9b38cd/attachment.htm>


More information about the gerrit-log mailing list