[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.
diff --git a/openbsc/src/gprs/gprs_llc.c b/openbsc/src/gprs/gprs_llc.c
index cd0a64f..ff6fe4b 100644
--- a/openbsc/src/gprs/gprs_llc.c
+++ b/openbsc/src/gprs/gprs_llc.c
@@ -776,8 +776,9 @@
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 */