VirtualBox

Changeset 53367 in vbox


Ignore:
Timestamp:
Nov 21, 2014 4:09:35 AM (10 years ago)
Author:
vboxsync
Message:

NAT/Net: pxping_recv4 - ensure that for small ping payloads we still
allocate enough for ICMP API to hold its internal data. Always add a
bit of extra space that is needed at least on Windows XP, empirically

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/pxping_win.c

    r53366 r53367  
    192192    }
    193193
    194     bufsize = sizeof(ICMP_ECHO_REPLY) + p->tot_len;
     194    bufsize = sizeof(ICMP_ECHO_REPLY);
     195    if (p->tot_len < sizeof(IO_STATUS_BLOCK) + sizeof(struct icmp_echo_hdr))
     196        bufsize += sizeof(IO_STATUS_BLOCK) + sizeof(struct icmp_echo_hdr);
     197    else
     198        bufsize += p->tot_len;
     199    bufsize += 16; /* whatever that is; empirically at least XP needs it */
     200
    195201    pong = (struct pong4 *)malloc(RT_OFFSETOF(struct pong4, buf) + bufsize);
    196202    if (RT_UNLIKELY(pong == NULL)) {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette