From c54407f455eaab62e2b254cac4ba4eab3986e776 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 14 Dec 2009 03:55:40 +0100 Subject: [PATCH] Fixed potential race condition in Html.validate(). --- src/dolda/jsvc/next/Html.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dolda/jsvc/next/Html.java b/src/dolda/jsvc/next/Html.java index 4c5b417..978cad2 100644 --- a/src/dolda/jsvc/next/Html.java +++ b/src/dolda/jsvc/next/Html.java @@ -45,7 +45,10 @@ public class Html extends DocBuffer { } public void validate() { - Validator val = schema.newValidator(); + Validator val; + synchronized(schema) { + val = schema.newValidator(); + } try { val.validate(new javax.xml.transform.dom.DOMSource(doc)); } catch(org.xml.sax.SAXException e) { -- 2.11.0