Change in osmo-pcu[master]: tbf: fix NULL pointer dereference in create_[ul|dl]_ass()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Feb 10 10:30:03 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/17105 )

Change subject: tbf: fix NULL pointer dereference in create_[ul|dl]_ass()
......................................................................

tbf: fix NULL pointer dereference in create_[ul|dl]_ass()

The problem is that bitvec_free() is not NULL-safe. Ideally we
need to fix it in libosmocore [1], but let's also fix it here,
so OsmoPCU can be safely used with older libosmocore versions.

[1] https://gerrit.osmocom.org/c/libosmocore/+/17114

Change-Id: I7647d17b3d03f8e193ef6e793a2d3c1967744eef
Fixes: CID#208181, CID#208179
---
M src/tbf.cpp
1 file changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/tbf.cpp b/src/tbf.cpp
index 2f79a98..5e222ae 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -1303,7 +1303,8 @@
 	return msg;
 
 free_ret:
-	bitvec_free(ass_vec);
+	if (ass_vec != NULL)
+		bitvec_free(ass_vec);
 	talloc_free(mac_control_block);
 	msgb_free(msg);
 	return NULL;
@@ -1398,7 +1399,8 @@
 	return msg;
 
 free_ret:
-	bitvec_free(ass_vec);
+	if (ass_vec != NULL)
+		bitvec_free(ass_vec);
 	talloc_free(mac_control_block);
 	msgb_free(msg);
 	return NULL;

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I7647d17b3d03f8e193ef6e793a2d3c1967744eef
Gerrit-Change-Number: 17105
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200210/dd0cec6c/attachment.htm>


More information about the gerrit-log mailing list