Changeset 58049 in vbox for trunk/src/VBox/Runtime/common/misc
- Timestamp:
- Oct 6, 2015 1:06:34 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103103
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/uri.cpp
r57983 r58049 122 122 { 123 123 AssertPtrReturn(pszString, NULL); 124 AssertReturn( strlen(pszString) >= cchString, NULL);124 AssertReturn(memchr(pszString, '\0', cchString) == NULL, NULL); 125 125 126 126 /* … … 797 797 */ 798 798 char *pszResult; 799 800 do801 { 802 char *pszTmp = pszResult = RTStrAlloc(cbResult);803 if ( pszTmp)799 char *pszTmp = pszResult = RTStrAlloc(cbResult); 800 if (pszTmp) 801 { 802 size_t cbTmp = cbResult; 803 if (uFormat == URI_FILE_FORMAT_WIN) 804 804 { 805 size_t cbTmp = cbResult; 806 807 if (uFormat == URI_FILE_FORMAT_WIN) 805 /* If an authority is given, add the required UNC prefix. */ 806 if (Parsed.cchAuthority) 808 807 { 809 /* If an authority is given, add the required UNC prefix. */ 810 if (Parsed.cchAuthority) 811 { 812 rc = RTStrCatP(&pszTmp, &cbTmp, "\\\\"); 813 if (RT_SUCCESS(rc)) 814 rc = RTStrCatPEx(&pszTmp, &cbTmp, &pszUri[Parsed.offAuthority], Parsed.cchAuthority); 815 } 808 rc = RTStrCatP(&pszTmp, &cbTmp, "\\\\"); 809 if (RT_SUCCESS(rc)) 810 /** @todo r=bird: YOU MUST DECODE THE STRING!! */ 811 rc = RTStrCatPEx(&pszTmp, &cbTmp, &pszUri[Parsed.offAuthority], Parsed.cchAuthority); 816 812 } 817 818 if (RT_SUCCESS(rc))819 rc = RTStrCatPEx(&pszTmp, &cbTmp, &pszUri[Parsed.offPath], Parsed.cchPath);820 821 if (RT_FAILURE(rc))822 RTStrFree(pszResult);823 813 } 824 else 825 rc = VERR_NO_MEMORY; 826 827 } while (0); 828 814 815 /** @todo r=bird: YOU MUST DECODE THE STRING!! */ 816 if (RT_SUCCESS(rc)) 817 rc = RTStrCatPEx(&pszTmp, &cbTmp, &pszUri[Parsed.offPath], Parsed.cchPath); 818 819 if (RT_FAILURE(rc)) 820 RTStrFree(pszResult); 821 } 822 else 823 rc = VERR_NO_MEMORY; 829 824 if (RT_SUCCESS(rc)) 830 825 {
Note:
See TracChangeset
for help on using the changeset viewer.