VirtualBox

Changeset 73995 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 31, 2018 10:39:08 AM (6 years ago)
Author:
vboxsync
Message:

IPRT/rest: fixes. bugref:9167

Location:
trunk/src/VBox/Runtime/common/rest
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/rest/RTCRestArrayBase.cpp

    r73978 r73995  
    179179        RTJsonIteratorFree(hIterator);
    180180    }
    181     else if (rcRet == VERR_JSON_IS_EMPTY)
     181    else if (   rcRet == VERR_JSON_IS_EMPTY
     182             || (   rcRet == VERR_JSON_VALUE_INVALID_TYPE
     183                 && RTJsonValueGetType(a_rCursor.m_hValue) == RTJSONVALTYPE_NULL) )
    182184        rcRet = VINF_SUCCESS;
    183185    else
    184         rcRet = a_rCursor.m_pPrimary->addError(a_rCursor, rcRet, "RTJsonIteratorBeginArray failed: %Rrc", rcRet);
     186        rcRet = a_rCursor.m_pPrimary->addError(a_rCursor, rcRet,
     187                                               "RTJsonIteratorBeginrray failed: %Rrc (type %s)",
     188                                               rcRet, RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue)));
    185189    return rcRet;
    186190
     
    272276        {
    273277            m_papElements = (RTCRestObjectBase **)pvNew;
    274             memset(m_papElements, 0, (a_cEnsureCapacity - m_cCapacity) * sizeof(sizeof(m_papElements[0])));
     278            memset(&m_papElements[m_cCapacity], 0, (a_cEnsureCapacity - m_cCapacity) * sizeof(sizeof(m_papElements[0])));
    275279            m_cCapacity   = a_cEnsureCapacity;
    276280        }
     
    295299            for (size_t i = 0; i < a_rThat.m_cElements; i++)
    296300            {
     301                AssertPtr(a_rThat.m_papElements[i]);
    297302                rc = insertCopyWorker(i, *a_rThat.m_papElements[i], false);
    298303                if (RT_SUCCESS(rc))
     
    337342            m_papElements[a_idx] = a_pValue;
    338343            m_cElements++;
     344#ifdef RT_STRICT
     345            for (size_t i = 0; i < m_cElements; i++)
     346                AssertPtr(m_papElements[i]);
     347#endif
    339348            return VINF_SUCCESS;
    340349        }
  • trunk/src/VBox/Runtime/common/rest/RTCRestClientResponseBase.cpp

    r73977 r73995  
    6565    , m_strContentType(a_rThat.m_strContentType)
    6666{
    67     if (m_pErrInfo)
    68         copyErrInfo(m_pErrInfo);
     67    if (a_rThat.m_pErrInfo)
     68        copyErrInfo(a_rThat.m_pErrInfo);
    6969}
    7070
  • trunk/src/VBox/Runtime/common/rest/RTCRestStringMapBase.cpp

    r73978 r73995  
    175175        RTJsonIteratorFree(hIterator);
    176176    }
    177     else if (rcRet == VERR_JSON_IS_EMPTY)
     177    else if (   rcRet == VERR_JSON_IS_EMPTY
     178             || (   rcRet == VERR_JSON_VALUE_INVALID_TYPE
     179                 && RTJsonValueGetType(a_rCursor.m_hValue) == RTJSONVALTYPE_NULL) )
    178180        rcRet = VINF_SUCCESS;
    179181    else
    180         rcRet = a_rCursor.m_pPrimary->addError(a_rCursor, rcRet, "RTJsonIteratorBegin failed: %Rrc", rcRet);
     182        rcRet = a_rCursor.m_pPrimary->addError(a_rCursor, rcRet, "RTJsonIteratorBegin failed: %Rrc (type %s)",
     183                                               rcRet, RTJsonValueTypeName(RTJsonValueGetType(a_rCursor.m_hValue)));
    181184    return rcRet;
    182185}
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