pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/30224 )
Change subject: osmux: Check received osmuxh->amr_ft is correct before using it
......................................................................
osmux: Check received osmuxh->amr_ft is correct before using it
Fixes: Coverity CID#283432
Change-Id: Iab525c5b7eb1e455a8229fb39e96897aac53298c
---
M src/osmux_output.c
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/24/30224/1
diff --git a/src/osmux_output.c b/src/osmux_output.c
index a6e6513..6b9f451 100644
--- a/src/osmux_output.c
+++ b/src/osmux_output.c
@@ -68,6 +68,11 @@
case OSMUX_FT_VOICE_AMR:
break;
case OSMUX_FT_DUMMY:
+ if (!osmo_amr_ft_valid(osmuxh->amr_ft)) {
+ LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: amr_ft=%u\n",
+ osmuxh->amr_ft);
+ return NULL;
+ }
len = osmux_ft_dummy_size(osmuxh->amr_ft, osmuxh->ctr + 1);
if (msgb_length(msg) < len) {
LOGP(DLMUX, LOGL_ERROR, "Discarding bad Dummy FT: %s\n",
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/30224
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Iab525c5b7eb1e455a8229fb39e96897aac53298c
Gerrit-Change-Number: 30224
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange