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

Unified Diff: Source/platform/text/LineEnding.cpp

Issue 26960002: Don't crash by form submission in a document with null encoding. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
« no previous file with comments | « LayoutTests/fast/forms/form-submit-in-image-document-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/text/LineEnding.cpp
diff --git a/Source/platform/text/LineEnding.cpp b/Source/platform/text/LineEnding.cpp
index eae0ebc55314ed0143d2b133f9b3a483a6591b68..05487b8d61c02fff0d4a6baad47b25a609254591 100644
--- a/Source/platform/text/LineEnding.cpp
+++ b/Source/platform/text/LineEnding.cpp
@@ -202,6 +202,8 @@ void normalizeToCROrLF(const CString& from, Vector<char>& result, bool toCR)
CString normalizeLineEndingsToCRLF(const CString& from)
{
+ if (!from.length())
+ return from;
CString result;
CStringBuffer buffer(result);
internalNormalizeLineEndingsToCRLF(from, buffer);
« no previous file with comments | « LayoutTests/fast/forms/form-submit-in-image-document-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698