laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-remsim/+/31179 )
Change subject: rest_api: strtoul canot return negative
......................................................................
rest_api: strtoul canot return negative
>> CID 307538: Control flow issues
(NO_EFFECT)
>> This less-than-zero comparison of an unsigned value is never true.
"map_id < 0UL".
Closes: CID#307538
Change-Id: Ic5019e216dd7b26be0bd988df218a2cb5775e411
---
M src/server/rest_api.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/79/31179/1
diff --git a/src/server/rest_api.c b/src/server/rest_api.c
index d3279c4..93ceb78 100644
--- a/src/server/rest_api.c
+++ b/src/server/rest_api.c
@@ -410,7 +410,7 @@
goto err;
}
map_id = strtoul(slotmap_id_str, NULL, 10);
- if (map_id < 0) {
+ if (map_id == ULONG_MAX) {
status = 400;
goto err;
}
--
To view, visit
https://gerrit.osmocom.org/c/osmo-remsim/+/31179
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: Ic5019e216dd7b26be0bd988df218a2cb5775e411
Gerrit-Change-Number: 31179
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange