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

Unified Diff: Source/core/svg/SVGLength.cpp

Issue 1069213003: SVGLength: Avoid reading out-of-bounds when parsing incorrect 'rem' unit (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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/svg/custom/svg-length-rem-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGLength.cpp
diff --git a/Source/core/svg/SVGLength.cpp b/Source/core/svg/SVGLength.cpp
index 1c37407b3be6f355b4f2c65a2cbe972992ca76fb..7b37c161fd9f5d31a7893774fd9767157be1d57c 100644
--- a/Source/core/svg/SVGLength.cpp
+++ b/Source/core/svg/SVGLength.cpp
@@ -98,7 +98,7 @@ SVGLengthType stringToLengthType(const CharType*& ptr, const CharType* end)
if (secondChar == 'x')
type = LengthTypeEXS;
} else if (firstChar == 'r') {
- if (secondChar == 'e') {
+ if (secondChar == 'e' && ptr < end) {
const CharType thirdChar = *ptr++;
if (thirdChar == 'm')
type = LengthTypeREMS;
« no previous file with comments | « LayoutTests/svg/custom/svg-length-rem-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698