1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

Add a missing m_pullup() before a mtod() in in_arpinput().

PR: kern/22177
Reviewed by: wollman
This commit is contained in:
Yaroslav Tykhiy 2001-03-27 12:34:58 +00:00
parent aa7664372f
commit 4cbc8ad1bb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=74851

View File

@ -519,6 +519,12 @@ in_arpinput(m)
struct in_addr isaddr, itaddr, myaddr;
int op, rif_len;
if (m->m_len < sizeof(struct ether_arp) &&
(m = m_pullup(m, sizeof(struct ether_arp))) == NULL) {
log(LOG_ERR, "in_arp: runt packet -- m_pullup failed\n");
return;
}
ea = mtod(m, struct ether_arp *);
op = ntohs(ea->arp_op);
(void)memcpy(&isaddr, ea->arp_spa, sizeof (isaddr));