diff options
author | 2021-12-24 11:35:57 +0100 | |
---|---|---|
committer | 2021-12-24 11:35:57 +0100 | |
commit | 29814a5374fe6f7bd79a9939c12cf3a098f59b59 (patch) | |
tree | 0a3817cb79d62fa1fc17c14740eed6f435c62d9f /src/gsm | |
parent | tcp_stats: fix compilation on CentOS 7 (diff) | |
download | libosmocore-29814a5374fe6f7bd79a9939c12cf3a098f59b59.tar.xz libosmocore-29814a5374fe6f7bd79a9939c12cf3a098f59b59.zip |
iuup: Fix signed/unsigned loop counter control flow issue
The use of an unsinged integer as for loop counter variable doesn't
work when counting down and comparing with >= 0. The existing code
would be an infinite loop if it wasn't for the (data dependent) break
condition:
>>> CID 243259: Control flow issues (NO_EFFECT)
>>> This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "i >= 0U".
572 for (i = 15; i >= 0; i--) {
573 if (match_mask & (1<<i)) {
574 iui->mode_version = i;
575 break;
576 }
Change-Id: I019d0f0d8f2b167575a2883a13cca692c96961cf
Closes: CID#243259
Diffstat (limited to 'src/gsm')
-rw-r--r-- | src/gsm/iuup.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gsm/iuup.c b/src/gsm/iuup.c index 159e533e..b838dc63 100644 --- a/src/gsm/iuup.c +++ b/src/gsm/iuup.c @@ -493,7 +493,7 @@ static bool iuup_rx_initialization(struct osmo_iuup_instance *iui, struct osmo_i struct iuup_ctrl_init_tail *itail; enum iuup_error_cause err_cause; uint8_t num_rfci = 0; - unsigned int i; + int i; bool is_last; uint16_t remote_mask, match_mask; struct osmo_iuup_tnl_prim *resp; |