VirtualBox

忽略:
時間撮記:
2019-4-20 下午11:49:01 (6 年 以前)
作者:
vboxsync
訊息:

Main/GuestCtrl: Fixed three i_waitForStatusChange() methods that would return VERR_GSTCTL_GUEST_ERROR without setting prcGuest, making the caller use uninitialized stack as status code for the operation. bugref:9320

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-client/GuestFileImpl.cpp

    r77587 r78234  
    10761076}
    10771077
     1078/**
     1079 * Undocumented, use with great care.
     1080 *
     1081 * @note Similar code in GuestProcess::i_waitForStatusChange() and
     1082 *       GuestSession::i_waitForStatusChange().
     1083 */
    10781084int GuestFile::i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS,
    10791085                                     FileStatus_T *pFileStatus, int *prcGuest)
     
    11161122            *prcGuest = (int)lGuestRc;
    11171123    }
     1124    /* waitForEvent may also return VERR_GSTCTL_GUEST_ERROR like we do above, so make prcGuest is set. */
     1125    /** @todo r=bird: Andy, you seem to have forgotten this scenario.  Showed up occasionally when
     1126     * using the wrong password with a copyto command in a debug  build on windows, error info
     1127     * contained "Unknown Status -858993460 (0xcccccccc)".  As you know windows fills the stack frames
     1128     * with 0xcccccccc in debug builds to highlight use of uninitialized data, so that's what happened
     1129     * here.  It's actually good you didn't initialize lGuest, as it would be heck to find otherwise.
     1130     *
     1131     * I'm still not very impressed with the error managment or the usuefullness of the documentation
     1132     * in this code, though the latter is getting better! */
     1133    else if (vrc == VERR_GSTCTL_GUEST_ERROR && prcGuest)
     1134        *prcGuest = pEvent->GuestResult();
     1135    Assert(vrc != VERR_GSTCTL_GUEST_ERROR || !prcGuest || *prcGuest != (int)0xcccccccc);
    11181136
    11191137    return vrc;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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