VirtualBox

Changeset 40061 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Feb 10, 2012 2:02:45 PM (13 years ago)
Author:
vboxsync
Message:

GuestCtrl/Main: Added some assertions for GetProcessOutput().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r40020 r40061  
    21142114                uHandleID = OUTPUT_HANDLE_ID_STDERR;
    21152115
     2116            /** @todo Use a buffer for next iteration if returned data is too big
     2117             *        for current read.
     2118             *        aSize is bogus -- will be ignored atm! */
    21162119            VBOXGUESTCTRL_CALLBACK callback;
    21172120            vrc = callbackInit(&callback, VBOXGUESTCTRLCALLBACKTYPE_EXEC_OUTPUT, pProgress);
     
    21822185                        if (pExecOut->cbData)
    21832186                        {
     2187                            bool fResize;
     2188
    21842189                            /* Do we need to resize the array? */
    21852190                            if (pExecOut->cbData > aSize)
    2186                                 outputData.resize(pExecOut->cbData);
     2191                            {
     2192                                fResize = outputData.resize(pExecOut->cbData);
     2193                                Assert(fResize);
     2194                            }
    21872195
    21882196                            /* Fill output in supplied out buffer. */
     2197                            Assert(outputData.size() >= pExecOut->cbData);
    21892198                            memcpy(outputData.raw(), pExecOut->pvData, pExecOut->cbData);
    2190                             outputData.resize(pExecOut->cbData); /* Shrink to fit actual buffer size. */
     2199                            fResize = outputData.resize(pExecOut->cbData); /* Shrink to fit actual buffer size. */
     2200                            Assert(fResize);
    21912201                        }
    21922202                        else
    21932203                        {
    21942204                            /* No data within specified timeout available. */
    2195                             outputData.resize(0);
     2205                            bool fResize = outputData.resize(0);
     2206                            Assert(fResize);
    21962207                        }
    21972208
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