You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2011/06/09 21:15:41 UTC
svn commit: r1134048 - in /tomcat/trunk:
java/org/apache/catalina/servlets/WebdavServlet.java
webapps/docs/changelog.xml
Author: markt
Date: Thu Jun 9 19:15:40 2011
New Revision: 1134048
URL: http://svn.apache.org/viewvc?rev=1134048&view=rev
Log:
Prevent possible NPE when processing WebDAV locks.
Modified:
tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1134048&r1=1134047&r2=1134048&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Thu Jun 9 19:15:40 2011
@@ -1337,13 +1337,15 @@ public class WebdavServlet
LockInfo toRenew = resourceLocks.get(path);
Enumeration<String> tokenList = null;
- // At least one of the tokens of the locks must have been given
- tokenList = toRenew.tokens.elements();
- while (tokenList.hasMoreElements()) {
- String token = tokenList.nextElement();
- if (ifHeader.indexOf(token) != -1) {
- toRenew.expiresAt = lock.expiresAt;
- lock = toRenew;
+ if (toRenew != null) {
+ // At least one of the tokens of the locks must have been given
+ tokenList = toRenew.tokens.elements();
+ while (tokenList.hasMoreElements()) {
+ String token = tokenList.nextElement();
+ if (ifHeader.indexOf(token) != -1) {
+ toRenew.expiresAt = lock.expiresAt;
+ lock = toRenew;
+ }
}
}
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1134048&r1=1134047&r2=1134048&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Jun 9 19:15:40 2011
@@ -85,6 +85,9 @@
<bug>51344</bug>: Fix problem with Lifecycle re-factoring for deprecated
embedded class that prevented events being triggered. (markt)
</fix>
+ <fix>
+ Prevent possible NPE when processing WebDAV locks. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org