pespin has uploaded this change for review.

View Change

iuup: Explicitly mark default case as unexpected with assert

That code path should not happen since this function is only called for
data frames coming with IUUP_FSM_EVT_IUUP_DATA_IND.
Control frames should come with specific events like
IUUP_FSM_EVT_IUUP_CONFIG_REQ.
Hence, let's add an assert to make sure we early exit if that ever
happens (it shouldn't), instead of carrying on reading uninitialized var
"dt".

Fixes: Coverity CID#272996
Change-Id: Iaeba59bc9ebfe817dbb7528572dc669c010ef14d
---
M src/gsm/iuup.c
1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/28480/1
diff --git a/src/gsm/iuup.c b/src/gsm/iuup.c
index ca7eb2b..c6a575e 100644
--- a/src/gsm/iuup.c
+++ b/src/gsm/iuup.c
@@ -476,6 +476,8 @@
dt.frame_nr = h1->frame_nr;
dt.fqc = h1->fqc;
break;
+ default:
+ OSMO_ASSERT(0);
}

/* pull up to the IuUP payload and push a new primitive header in front */

To view, visit change 28480. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iaeba59bc9ebfe817dbb7528572dc669c010ef14d
Gerrit-Change-Number: 28480
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange