X-Git-Url: https://git.saurik.com/apple/ipsec.git/blobdiff_plain/d1e348cfd503b08e7d34b7683d23aae209af0a71..476121220b14176dcbf5f70f47b9ef8e38f8b389:/ipsec-tools/racoon/admin.c diff --git a/ipsec-tools/racoon/admin.c b/ipsec-tools/racoon/admin.c index ea11b4e..d8e16b9 100644 --- a/ipsec-tools/racoon/admin.c +++ b/ipsec-tools/racoon/admin.c @@ -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);