]> git.saurik.com Git - apple/ipsec.git/blobdiff - ipsec-tools/racoon/admin.c
ipsec-92.4.tar.gz
[apple/ipsec.git] / ipsec-tools / racoon / admin.c
index ea11b4e462a7117cbe1b0a75637ea5bf78f0a230..d8e16b984967bca6e438c1788ce5ae54a2f48fcc 100644 (file)
@@ -316,16 +316,18 @@ out2:
 #ifdef ENABLE_HYBRID
        case ADMIN_LOGOUT_USER: {
                struct ph1handle *iph1;
-               char *user;
-               int found = 0;
+               char user[LOGINLEN+1];
+               int found = 0, len = com->ac_len - sizeof(com);
 
-               if (com->ac_len > sizeof(com) + LOGINLEN + 1) {
+               if (len > LOGINLEN) {
                        plog(LLV_ERROR, LOCATION, NULL,
                            "malformed message (login too long)\n");
                        break;
                }
 
-               user = (char *)(com + 1);
+               memcpy(user, (char *)(com + 1), len);
+               user[len] = 0;
+
                found = purgeph1bylogin(user);
                plog(LLV_INFO, LOCATION, NULL, 
                    "deleted %d SA for user \"%s\"\n", found, user);