VirtualBox

Changeset 96492 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Aug 25, 2022 2:34:59 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
153340
Message:

NAT: Zero newly allocated memory for sbufs to avoid potential
information leakage. bugref:10283

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/sbuf.c

    r96407 r96492  
    9191            sb->sb_wptr =
    9292            sb->sb_rptr =
    93             sb->sb_data = (char *)RTMemRealloc(sb->sb_data, size);
     93            sb->sb_data = (char *)RTMemReallocZ(sb->sb_data, sb->sb_datalen, size);
    9494            sb->sb_cc = 0;
    9595            if (sb->sb_wptr)
     
    101101    else
    102102    {
    103         sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)RTMemAlloc(size);
     103        sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)RTMemAllocZ(size);
    104104        sb->sb_cc = 0;
    105105        if (sb->sb_wptr)
     
    157157        if (m->m_next)
    158158        {
    159             buf = RTMemAlloc(mlen);
     159            buf = RTMemAllocZ(mlen);
    160160            if (buf == NULL)
    161161            {
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