laforge has submitted this change. ( 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(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/server/rest_api.c b/src/server/rest_api.c index d3279c4..6e025ad 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 && errno != 0) { status = 400; goto err; }