Change in libosmocore[master]: Fix ipa_ccm_make_id_resp_from_req

laforge gerrit-no-reply at lists.osmocom.org
Thu Apr 29 19:14:54 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/23977 )

Change subject: Fix ipa_ccm_make_id_resp_from_req
......................................................................

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
---
M src/gsm/ipa.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index 7a26ba4..fdc0bc6 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -427,9 +427,9 @@
 		/* 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);
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/23977
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I344975d0bda565ff196a1c0c69305cd349b98a19
Gerrit-Change-Number: 23977
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-CC: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210429/a98678a0/attachment.htm>


More information about the gerrit-log mailing list