VirtualBox

Changeset 19256 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 29, 2009 11:08:16 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: VBoxMediaComboBox crash vulnerability of empty combo-box fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxMediaComboBox.cpp

    r19239 r19256  
    102102QString VBoxMediaComboBox::id (int aIndex /*= -1*/) const
    103103{
    104     QString uuidNull; /* gcc-3.3 hack */
    105     AssertReturn (aIndex == -1 ||
    106                   (aIndex >= 0 && aIndex < mMedia.size()),
    107                   uuidNull);
    108 
    109     return mMedia [aIndex == -1 ? currentIndex() : aIndex].id;
    110 }
    111 
    112 QString VBoxMediaComboBox::location (int aIndex /*= -1*/) const
    113 {
    114104    AssertReturn (aIndex == -1 ||
    115105                  (aIndex >= 0 && aIndex < mMedia.size()),
    116106                  QString::null);
    117107
    118     return mMedia [aIndex == -1 ? currentIndex() : aIndex].location;
     108    if (aIndex == -1) aIndex = currentIndex();
     109    return aIndex == -1 ? QString::null : mMedia [aIndex].id;
     110}
     111
     112QString VBoxMediaComboBox::location (int aIndex /*= -1*/) const
     113{
     114    AssertReturn (aIndex == -1 ||
     115                  (aIndex >= 0 && aIndex < mMedia.size()),
     116                  QString::null);
     117
     118    if (aIndex == -1) aIndex = currentIndex();
     119    return aIndex == -1 ? QString::null : mMedia [aIndex].location;
    119120}
    120121
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