diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-16 09:49:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-16 09:49:08 -0800 |
commit | 87682ef26d821b434beec73eb3c6a3487f124c1e (patch) | |
tree | ff278128ca7fa155bc3fdcfa827e28b40f76b149 | |
parent | 2e0f02b5fbbd098335e38585b2651056c9d7dee8 (diff) | |
parent | 891e8162e409b7048297c5b820a399f19f2a020b (diff) |
Merge pull request #9742 from ctiller/cgi
Fix escaping in index.html
-rwxr-xr-x | tools/run_tests/run_microbenchmark.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/run_tests/run_microbenchmark.py b/tools/run_tests/run_microbenchmark.py index 4884911c99..262c05b421 100755 --- a/tools/run_tests/run_microbenchmark.py +++ b/tools/run_tests/run_microbenchmark.py @@ -28,6 +28,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +import cgi import multiprocessing import os import subprocess @@ -71,11 +72,12 @@ def heading(name): def link(txt, tgt): global index_html - index_html += "<p><a href=\"%s\">%s</a></p>\n" % (tgt, txt) + index_html += "<p><a href=\"%s\">%s</a></p>\n" % ( + cgi.escape(tgt, quote=True), cgi.escape(txt)) def text(txt): global index_html - index_html += "<p><pre>%s</pre></p>\n" % txt + index_html += "<p><pre>%s</pre></p>\n" % cgi.escape(txt) def collect_latency(bm_name, args): """generate latency profiles""" |