VirtualBox

Ignore:
Timestamp:
Feb 15, 2023 12:24:25 AM (2 years ago)
Author:
vboxsync
Message:

HGCMMock.h,tstGuestControlMockHGCM: Fixed memory overrun wrt client memory. Quick fix for use-after-free wrt call parameters (may still leak stuff because the code seems a bit uncertain about who does what). Disabled some non-working copy-paste tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/testcase/tstGuestControlMockHGCM.cpp

    r98526 r98574  
    2626 */
    2727
     28
     29/*********************************************************************************************************************************
     30*   Header Files                                                                                                                 *
     31*********************************************************************************************************************************/
    2832#include <VBox/HostServices/GuestControlSvc.h>
    2933#include <VBox/VBoxGuestLib.h>
     
    5155*   Shared Clipboard testing                                                                                                     *
    5256*********************************************************************************************************************************/
     57/** @todo r=bird: Clipboard?  */
     58
    5359struct CLIPBOARDTESTDESC;
    5460/** Pointer to a test description. */
     
    103109CLIPBOARDTESTCTX g_TstCtx;
    104110
     111#if 0 /** @todo r=bird: Clipboard? This times out and asserts and doesn't seems to do anything sensible. */
     112
    105113/**
    106114 * Structure for keeping a clipboard test description.
     
    120128} SHCLCONTEXT;
    121129
     130#endif
     131
    122132
    123133static void testGuestSimple(void)
     
    155165 * Test: Guest reading from host                                                                                                 *
    156166 ********************************************************************************************************************************/
     167/** @todo r=bird: Reading from the host? WTF?  Doesn't seem to work, so I've disabled it till it can be rewritten and
     168 * made to do something useful rather than asserting. */
     169#if 0
    157170typedef struct TSTUSERMOCK
    158171{
     
    193206{
    194207    RT_NOREF(pTstCtx, ppvCtx);
    195 
    196     int rc = VINF_SUCCESS;
    197 
    198     return rc;
     208    return VINF_SUCCESS;
    199209}
    200210
     
    233243}
    234244
     245#endif
     246
    235247
    236248/*********************************************************************************************************************************
    237249 * Main                                                                                                                          *
    238250 ********************************************************************************************************************************/
     251#if 0 /** @todo r=bird: Same as above.  */
    239252
    240253/** Test definition table. */
     
    265278}
    266279
    267 int main(int argc, char *argv[])
     280#endif
     281
     282int main()
    268283{
    269284    /*
    270285     * Init the runtime, test and say hello.
    271286     */
    272     const char *pcszExecName;
    273     NOREF(argc);
    274     pcszExecName = strrchr(argv[0], '/');
    275     pcszExecName = pcszExecName ? pcszExecName + 1 : argv[0];
    276     RTEXITCODE rcExit = RTTestInitAndCreate(pcszExecName, &g_hTest);
     287    RTEXITCODE rcExit = RTTestInitAndCreate("tstGuestControlMockHGCM", &g_hTest);
    277288    if (rcExit != RTEXITCODE_SUCCESS)
    278289        return rcExit;
    279290    RTTestBanner(g_hTest);
    280291
    281 #ifndef DEBUG_andy
     292#if 0 //ndef DEBUG_andy - bird: fix the 'ing code.
    282293    /* Don't let assertions in the host service panic (core dump) the test cases. */
    283294    RTAssertSetMayPanic(false);
     
    285296
    286297    PTSTHGCMMOCKSVC const pSvc = TstHgcmMockSvcInst();
    287 
    288     TstHgcmMockSvcCreate(pSvc, 42 /** @todo */);
     298    TstHgcmMockSvcCreate(pSvc);
    289299    TstHgcmMockSvcStart(pSvc);
    290300
     
    298308    }
    299309
     310#if 0 /** @todo r=bird: Clipboard? This times out and asserts and doesn't seems to do anything sensible. */
    300311    RT_ZERO(g_TstCtx);
    301312
     
    311322
    312323    TstHGCMUtilsTaskDestroy(pTask);
     324#endif
    313325
    314326    TstHgcmMockSvcStop(pSvc);
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