From 3e2e159707c48e8eb52549989eee849417264c97 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 30 Jun 2010 23:19:23 +0200 Subject: [SGSN] LLC: only copy Kc if algorithm != GPRS_ALGO_GEA0 The caller currently has set the Kc pointer to NULL, this fix avoids crashing at the callee. --- openbsc/src/gprs/gprs_llc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openbsc/src/gprs/gprs_llc.c') diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c index cd0a64f3a..ff6fe4bc2 100644 --- a/openbsc/src/gprs/gprs_llc.c +++ b/openbsc/src/gprs/gprs_llc.c @@ -776,8 +776,9 @@ int gprs_llgmm_assign(struct gprs_llc_llme *llme, unsigned int i; /* Update the crypto parameters */ - memcpy(llme->kc, kc, sizeof(llme->kc)); llme->algo = alg; + if (alg != GPRS_ALGO_GEA0) + memcpy(llme->kc, kc, sizeof(llme->kc)); if (old_tlli == 0xffffffff && new_tlli != 0xffffffff) { /* TLLI Assignment 8.3.1 */ -- cgit v1.2.3