osmo_sccp_user_sap_down(): Avoid uninitialized pointer deref

When receiving an unknown primitive, we end up de-referencing an
unassigned/uninitialized pointer for 'conn'.  Let's properly catch that
case and print an error message.

Change-Id: Id1f5f293ea9bce8601d45164be670a7062d91802
Fixes: coverity CID#166947
This commit is contained in:
Harald Welte 2017-04-27 11:48:15 +02:00
parent 48c720bffc
commit 4c880a02f4
1 changed files with 5 additions and 0 deletions

View File

@ -1628,6 +1628,11 @@ int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *op
goto out;
}
break;
default:
LOGP(DLSCCP, LOGL_ERROR, "Received unknown primitive %s\n",
osmo_scu_prim_name(&prim->oph));
rc = -1;
goto out;
}
/* Map from primitive to event */