aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-04-29 15:52:38 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-29 19:55:43 +0200
commit539272dd8e4a2db2ce9489478f0c099e6e1be8e0 (patch)
tree8a5be4ed598a8e35e5680088e20dc81551fe6cbb /src/gsm
parentns2: Allow setting the socket priority for a UDP bind (diff)
downloadlibosmocore-539272dd8e4a2db2ce9489478f0c099e6e1be8e0.tar.xz
libosmocore-539272dd8e4a2db2ce9489478f0c099e6e1be8e0.zip
Fix ipa_ccm_make_id_resp_from_req
In 2018, I4723361e1094b358310541a7dc4c5c921c778a15 introuced a check against an integer unterflow. However, the fheck got the logic wrong, with the result of breaking the function completely: It would always only detect the first tag within the IPA request and then take the branch that assumes an integer underflow. Change-Id: I344975d0bda565ff196a1c0c69305cd349b98a19
Diffstat (limited to 'src/gsm')
-rw-r--r--src/gsm/ipa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index 7a26ba45..fdc0bc6f 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -427,9 +427,9 @@ struct msgb *ipa_ccm_make_id_resp_from_req(const struct ipaccess_unit *dev,
/* prevent any unsigned integer underflow due to somebody sending us
* messages with wrong length values */
if (len <= t_len)
- len -= t_len;
- else
len = 0;
+ else
+ len -= t_len;
}
return ipa_ccm_make_id_resp(dev, ies, num_ies);
}