VirtualBox

Changeset 12143 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Sep 5, 2008 3:57:39 PM (16 years ago)
Author:
vboxsync
Message:

disk: ixed a bunch of NULL pointer accesses

Location:
trunk/src/VBox/Devices/Storage
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/RawHDDCore.cpp

    r11484 r12143  
    396396    {
    397397        pCbProgress = VDGetInterfaceProgress(pIfProgress);
    398         pfnProgress = pCbProgress->pfnProgress;
     398        if (pCbProgress)
     399            pfnProgress = pCbProgress->pfnProgress;
    399400        pvUser = pIfProgress->pvUser;
    400401    }
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r12116 r12143  
    15061506    }
    15071507
    1508     if (RT_SUCCESS(rc) && pCbProgress->pfnProgress)
     1508    if (RT_SUCCESS(rc) && pCbProgress && pCbProgress->pfnProgress)
    15091509        pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */, 100,
    15101510                                 pIfProgress->pvUser);
     
    17011701    }
    17021702
    1703     if (RT_SUCCESS(rc) && pCbProgress->pfnProgress)
     1703    if (RT_SUCCESS(rc) && pCbProgress && pCbProgress->pfnProgress)
    17041704        pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */, 100,
    17051705                                 pIfProgress->pvUser);
     
    18271827                cbRemaining -= cbThisRead;
    18281828
    1829                 if (pCbProgress->pfnProgress)
     1829                if (pCbProgress && pCbProgress->pfnProgress)
    18301830                {
    18311831                    rc = pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */,
     
    18761876                cbRemaining -= cbThisRead;
    18771877
    1878                 if (pCbProgress->pfnProgress)
     1878                if (pCbProgress && pCbProgress->pfnProgress)
    18791879                {
    18801880                    rc = pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */,
     
    19441944        RTMemTmpFree(pvBuf);
    19451945
    1946     if (RT_SUCCESS(rc) && pCbProgress->pfnProgress)
     1946    if (RT_SUCCESS(rc) && pCbProgress && pCbProgress->pfnProgress)
    19471947        pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */, 100,
    19481948                                 pIfProgress->pvUser);
     
    21482148            cbRemaining -= cbThisRead;
    21492149
    2150             if (pCbProgress->pfnProgress)
     2150            if (pCbProgress && pCbProgress->pfnProgress)
    21512151            {
    21522152                rc = pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */,
     
    22132213    if (RT_SUCCESS(rc))
    22142214    {
    2215         if (pCbProgress->pfnProgress)
     2215        if (pCbProgress && pCbProgress->pfnProgress)
    22162216            pCbProgress->pfnProgress(NULL /* WARNING! pVM=NULL */, 100,
    22172217                                     pIfProgress->pvUser);
  • trunk/src/VBox/Devices/Storage/VDIHDDCore.cpp

    r11484 r12143  
    834834    {
    835835        pCbProgress = VDGetInterfaceProgress(pIfProgress);
    836         pfnProgress = pCbProgress->pfnProgress;
     836        if (pCbProgress)
     837            pfnProgress = pCbProgress->pfnProgress;
    837838        pvUser = pIfProgress->pvUser;
    838839    }
  • trunk/src/VBox/Devices/Storage/VHDHDDCore.cpp

    r12116 r12143  
    16001600    {
    16011601        pCbProgress = VDGetInterfaceProgress(pIfProgress);
    1602         pfnProgress = pCbProgress->pfnProgress;
     1602        if (pCbProgress)
     1603            pfnProgress = pCbProgress->pfnProgress;
    16031604        pvUser = pIfProgress->pvUser;
    16041605    }
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