From ffbc0d9a08f8443e67965f03dc0ae427c7f8d145 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 17 Jul 2017 09:29:05 -0700 Subject: More tightly validate format strings in util.cpp. 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 Reviewed-by: dsinclair --- testing/resources/javascript/bug_740166.in | 5 ++++- testing/resources/javascript/bug_740166_expected.txt | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'testing/resources') 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 -- cgit v1.2.3