VirtualBox

Changeset 58066 in vbox for trunk


Ignore:
Timestamp:
Oct 6, 2015 6:50:59 PM (9 years ago)
Author:
vboxsync
Message:

RTUriFileCreate: NULL and empty input paths are invalid, period.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/uri.cpp

    r58050 r58066  
    679679RTDECL(char *) RTUriFileCreate(const char *pszPath)
    680680{
     681    /* Empty paths are invalid. */
     682    AssertPtrReturn(pszPath, NULL);
     683    AssertReturn(*pszPath, NULL);
     684
    681685    char *pszResult = NULL;
    682686    if (pszPath)
     
    713717            RTStrFree(pszPath1);
    714718        }
    715     }
    716     else
    717     {
    718         char *pszResTmp;
    719         int cchRes = RTStrAPrintf(&pszResTmp, "file://");
    720         if (cchRes)
    721             pszResult = pszResTmp;
    722719    }
    723720
  • trunk/src/VBox/Runtime/testcase/tstRTUri.cpp

    r58065 r58066  
    333333        /* .uFormat          =*/ URI_FILE_FORMAT_UNIX,
    334334        /* .pszCreatedPath   =*/ NULL,
    335         /* .pszCreatedUri    =*/ "file://",
     335        /* .pszCreatedUri    =*/ NULL,
    336336        /* PathCreateFromUrl =   "" - differs */
    337337        /* UrlCreateFromPath => 0x80070057 (E_INVALIDARG) */
     
    342342        /* .uFormat          =*/ URI_FILE_FORMAT_WIN,
    343343        /* .pszCreatedPath   =*/ NULL,
    344         /* .pszCreatedUri    =*/ "file://",
     344        /* .pszCreatedUri    =*/ NULL,
    345345        /* PathCreateFromUrl =   "" - differs */
    346346        /* UrlCreateFromPath => 0x80070057 (E_INVALIDARG) */
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