Changeset 74179 in vbox for trunk/src/VBox/Runtime/common/misc
- Timestamp:
- Sep 10, 2018 10:46:31 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/json.cpp
r74175 r74179 695 695 { 696 696 /* The must be a low surrogate pair following the high one: */ 697 rc = VINF_SUCCESS; 697 698 ch = rtJsonTokenizerGetCh(pTokenizer); 698 699 if (ch == '\\') … … 741 742 if (RT_SUCCESS(rc)) 742 743 { 743 Assert(cchStr + RTStrCpSize(uc) < cchStrMax); 744 char *pszNext = RTStrPutCp(&pszDecoded[cchStr], uc); 745 Assert((size_t)(pszNext - &pszDecoded[cchStr]) == RTStrCpSize(uc)); 746 cchStr += pszNext - &pszDecoded[cchStr]; 747 break; 744 if ( uc != 0 745 && uc != 0xfffe 746 && uc != 0xffff) 747 { 748 Assert(cchStr + RTStrCpSize(uc) < cchStrMax); 749 char *pszNext = RTStrPutCp(&pszDecoded[cchStr], uc); 750 Assert((size_t)(pszNext - &pszDecoded[cchStr]) == RTStrCpSize(uc)); 751 cchStr += pszNext - &pszDecoded[cchStr]; 752 break; 753 } 754 rc = RTErrInfoSetF(pTokenizer->pErrInfo, VERR_JSON_INVALID_CODEPOINT, 755 "Invalid \\u code point: %#x (line %zu col %zu)", 756 uc, pTokenizer->Pos.iLine, pTokenizer->Pos.iChStart); 748 757 } 749 758 } … … 758 767 rc = RTErrInfoSetF(pTokenizer->pErrInfo, rc, "Missing UTF-16 surrogate pair (line %zu col %zu)", 759 768 pTokenizer->Pos.iLine, pTokenizer->Pos.iChStart); 760 else 769 else if (rc == VERR_JSON_BAD_SURROGATE_PAIR_SEQUENCE) 761 770 rc = RTErrInfoSetF(pTokenizer->pErrInfo, rc, "Invalid UTF-16 surrogate pair (line %zu col %zu)", 762 771 pTokenizer->Pos.iLine, pTokenizer->Pos.iChStart);
Note:
See TracChangeset
for help on using the changeset viewer.