From: Fredrik Tolf Date: Mon, 14 Dec 2009 02:55:40 +0000 (+0100) Subject: Fixed potential race condition in Html.validate(). X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=c54407f455eaab62e2b254cac4ba4eab3986e776;p=jsvc.git Fixed potential race condition in Html.validate(). --- 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) {