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

Unified Diff: LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html

Issue 188693007: Added checks for integer overflow conditions to deleteData and replaceData. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed typo Created 6 years, 9 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: LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
diff --git a/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html b/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
new file mode 100644
index 0000000000000000000000000000000000000000..0182068f6d0fe187a1667f93840a2d2e59b9ad36
--- /dev/null
+++ b/LayoutTests/fast/dom/Range/deleteData-replaceData-count-overflow.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test checks to make sure that deleteData does not overflow with a large 'count' parameter</p>
+<div id="result1">FAIL</div>
+<div id="result2">FAIL</div>
+<script type="text/javascript">
+var a = new Text("aaaaaaaaaa");
+document.body.appendChild(a);
+
+document.getSelection().extend(a, 10);
+range = document.getSelection().getRangeAt(0);
+
+try {
+ a.deleteData(9, 0xfffffff7);
+} catch(ex) {
+ document.getElementById("result1").innerText = "deleteData - PASS";
+}
+
+window.getSelection().removeAllRanges();
+
+var b = new Text("bbbbbbbbbb");
+document.body.appendChild(b);
+
+document.getSelection().extend(b, 10);
+range = document.getSelection().getRangeAt(0);
+
+try {
Inactive 2014/03/17 00:04:33 It would also be nice if this test used js-test.js
+ b.replaceData(9, 0xfffffff7);
+} catch(ex) {
+ document.getElementById("result2").innerText = "replaceData - PASS";
+}
+
+if (window.testRunner) {
+ window.testRunner.dumpAsText();
+}
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698