summaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-04-07 17:49:48 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-07 20:13:43 +0200
commit5b512051870017aebd79ff2ca05ad8be671728b2 (patch)
tree6e75860ff3ed29c1420305cfc3ae470adadf6af9 /openbsc/tests
parent9ed6fd25dde40e3079c5b278f543714b0d78a9f0 (diff)
gprs: Fix GSUP cancel_type handling (Coverity)
When handling an incoming GSUP cancellation request, the cancel_type if effectively ignored, such that is always handled as GPRS_GSUP_CANCEL_TYPE_UPDATE and never as WITHDRAW. This commit fixes the expression used to set the variable is_update_procedure. Fixes: Coverity CID 1267739 Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 6fc4f99..197be9d 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -440,6 +440,12 @@ static void test_subscriber_gsup(void)
0x06, 0x01, 0x00,
};
+ static const uint8_t location_cancellation_req_withdraw[] = {
+ 0x1c,
+ TEST_GSUP_IMSI1_IE,
+ 0x06, 0x01, 0x01,
+ };
+
static const uint8_t location_cancellation_req_other[] = {
0x1c,
0x01, 0x05, 0x11, 0x11, 0x11, 0x11, 0x01,
@@ -582,6 +588,12 @@ static void test_subscriber_gsup(void)
OSMO_ASSERT(s1->flags & GPRS_SUBSCRIBER_CANCELLED);
OSMO_ASSERT(s1->sgsn_data->mm == NULL);
+ /* Inject LocCancelReq(withdraw) GSUP message */
+ rc = rx_gsup_message(location_cancellation_req_withdraw,
+ sizeof(location_cancellation_req_withdraw));
+ OSMO_ASSERT(rc >= 0);
+ OSMO_ASSERT(s1->sgsn_data->error_cause == GMM_CAUSE_IMPL_DETACHED);
+
/* Inject PurgeMsRes GSUP message */
rc = rx_gsup_message(purge_ms_res,
sizeof(purge_ms_res));