]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
opc may be NULL
authorAlan T. DeKok <aland@freeradius.org>
Mon, 11 Dec 2017 21:49:14 +0000 (16:49 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 11 Dec 2017 21:49:39 +0000 (16:49 -0500)
src/modules/rlm_eap/lib/sim/vector.c

index 92a4a3691dbecd9d81d44c43fcd92fe5061a79b4..f73e709bba97bb26a7c3a77095cb239b48924a77 100644 (file)
@@ -37,7 +37,7 @@ RCSID("$Id$")
 static int vector_gsm_from_ki(eap_session_t *eap_session, VALUE_PAIR *vps, int idx, fr_sim_keys_t *keys)
 {
        REQUEST         *request = eap_session->request;
-       VALUE_PAIR      *ki, *opc, *version_vp;
+       VALUE_PAIR      *ki, *version_vp, *opc = NULL;
        uint32_t        version;
        int             i;
 
@@ -102,6 +102,11 @@ static int vector_gsm_from_ki(eap_session_t *eap_session, VALUE_PAIR *vps, int i
                break;
 
        case 4:
+               if (!opc) {
+                       RPEDEBUG2("No SIM-OPc");
+                       return -1;
+               }
+
                if (milenage_gsm_generate(keys->gsm.vector[idx].sres,
                                          keys->gsm.vector[idx].kc,
                                          opc->vp_octets,