tighten isakmp header length validation. from kame

This commit is contained in:
itojun 2002-08-28 04:44:04 +00:00
parent b6aefbe19f
commit bcb0cf6929

View File

@ -173,8 +173,8 @@ isakmp_handler(so_isakmp)
goto end;
}
/* check isakmp header length */
if (len < sizeof(isakmp)) {
/* check isakmp header length, as well as sanity of header length */
if (len < sizeof(isakmp) || ntohl(isakmp.len) < sizeof(isakmp)) {
plog(LLV_ERROR, LOCATION, (struct sockaddr *)&remote,
"packet shorter than isakmp header size.\n");
/* dummy receive */