VirtualBox

Ignore:
Timestamp:
Jul 5, 2013 9:56:14 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
87014
Message:

Main/solaris/NetIf: sane limit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp

    r46996 r46997  
    419419        if (!rc)
    420420        {
    421             int cbIfaces = IfNum.lifn_count * sizeof(struct lifreq);
     421            int cIfaces = RT_MIN(1024, IfNum.lifn_count); /* sane limit */
     422            int cbIfaces = cIfaces * sizeof(struct lifreq);
    422423            struct lifreq *Ifaces = (struct lifreq *)RTMemTmpAlloc(cbIfaces);
    423424            if (Ifaces)
     
    431432                if (!rc)
    432433                {
    433                     for (int i = 0; i < IfNum.lifn_count; i++)
     434                    for (int i = 0; i < cIfaces; i++)
    434435                    {
    435436                        /*
Note: See TracChangeset for help on using the changeset viewer.

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