summaryrefslogtreecommitdiff
path: root/testing/resources/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-07-17 09:29:05 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-07-17 16:44:06 +0000
commitffbc0d9a08f8443e67965f03dc0ae427c7f8d145 (patch)
tree4406f3721977421f76aa28bc6b264dcc58c5c077 /testing/resources/javascript
parent0b7378afe3dee6db6cff8ee834e758d3a76efa3b (diff)
downloadpdfium-ffbc0d9a08f8443e67965f03dc0ae427c7f8d145.tar.xz
More tightly validate format strings in util.cpp.chromium/3160
Re-work the previous fix to be even more particular about the input. Bug: chromium:740166 Change-Id: I6bea3b6a6dd320a83f830b07afd52951be7d1b63 Reviewed-on: https://pdfium-review.googlesource.com/7691 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing/resources/javascript')
-rw-r--r--testing/resources/javascript/bug_740166.in5
-rw-r--r--testing/resources/javascript/bug_740166_expected.txt4
2 files changed, 8 insertions, 1 deletions
diff --git a/testing/resources/javascript/bug_740166.in b/testing/resources/javascript/bug_740166.in
index 62bc912e31..1e2eb910ff 100644
--- a/testing/resources/javascript/bug_740166.in
+++ b/testing/resources/javascript/bug_740166.in
@@ -47,7 +47,10 @@ endobj
{{object 11 0}} <<
>>
stream
-app.alert("Value " + util.printf("= %0.769x", 1));
+app.alert(util.printf("Values = %0.1x .9999 %x", 1, 2));
+app.alert(util.printf("Values = %0.10x .9999 %x", 1, 2));
+app.alert(util.printf("Values = %0.100x .9999 %x", 1, 2));
+app.alert(util.printf("Values = %0.1000x .9999 %x", 1, 2));
endstream
endobj
{{xref}}
diff --git a/testing/resources/javascript/bug_740166_expected.txt b/testing/resources/javascript/bug_740166_expected.txt
index e69de29bb2..1cece3bff8 100644
--- a/testing/resources/javascript/bug_740166_expected.txt
+++ b/testing/resources/javascript/bug_740166_expected.txt
@@ -0,0 +1,4 @@
+Alert: Values = 1 .9999 2
+Alert: Values = 0000000001 .9999 2
+Alert: Values = %0.100x .9999 2
+Alert: Values = %0.1000x .9999 2