Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp

Issue 2098523002: Fix some issues found by coverity scans on Node.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp b/third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp
index 08c3e448c3b29419bae8a2a108d56fd057754b91..4883f4ceda46e11f284f06dc4909a8d2f47eca32 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/String16STL.cpp
@@ -562,20 +562,14 @@ std::string String16::utf8() const
char* buffer = bufferVector.data();
const UChar* characters = m_impl.data();
- bool strict = false;
- ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), strict);
+ ConversionResult result = convertUTF16ToUTF8(&characters, characters + length, &buffer, buffer + bufferVector.size(), false);
DCHECK(result != targetExhausted); // (length * 3) should be sufficient for any conversion
// Only produced from strict conversion.
- if (result == sourceIllegal) {
- DCHECK(strict);
- return std::string();
- }
+ DCHECK(result != sourceIllegal);
// Check for an unconverted high surrogate.
if (result == sourceExhausted) {
- if (strict)
- return std::string();
// This should be one unpaired high surrogate. Treat it the same
// was as an unpaired high surrogate would have been handled in
// the middle of a string with non-strict conversion - which is

Powered by Google App Engine
This is Rietveld 408576698