VirtualBox

Changeset 86387 in vbox for trunk


Ignore:
Timestamp:
Oct 1, 2020 2:44:33 PM (4 years ago)
Author:
vboxsync
Message:

IPRT/RTTraceLogWr*: Ignore NIL on destroy (iprt protocol) and always verify magic. bugref:9841

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/log/tracelogwriter.cpp

    r82968 r86387  
    859859RTDECL(int) RTTraceLogWrDestroy(RTTRACELOGWR hTraceLogWr)
    860860{
     861    if (hTraceLogWr == NIL_RTTRACELOGWR)
     862        return VINF_SUCCESS;
    861863    PRTTRACELOGWRINT pThis = hTraceLogWr;
    862864    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     865    AssertReturn(pThis->u32Magic == RTTRACELOGWR_MAGIC, VERR_INVALID_HANDLE);
    863866
    864867    pThis->u32Magic = RTTRACELOGWR_MAGIC_DEAD;
     
    875878    PRTTRACELOGWRINT pThis = hTraceLogWr;
    876879    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     880    AssertReturn(pThis->u32Magic == RTTRACELOGWR_MAGIC, VERR_INVALID_HANDLE);
    877881    AssertPtrReturn(pEvtDesc, VERR_INVALID_POINTER);
    878882
     
    887891    PRTTRACELOGWRINT pThis = hTraceLogWr;
    888892    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     893    AssertReturn(pThis->u32Magic == RTTRACELOGWR_MAGIC, VERR_INVALID_HANDLE);
    889894
    890895    int rc = VINF_SUCCESS;
     
    920925    PRTTRACELOGWRINT pThis = hTraceLogWr;
    921926    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     927    AssertReturn(pThis->u32Magic == RTTRACELOGWR_MAGIC, VERR_INVALID_HANDLE);
    922928
    923929    int rc = VINF_SUCCESS;
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