Author: fhanik
Date: Thu Jun 26 12:48:30 2008
New Revision: 672012

URL: http://svn.apache.org/viewvc?rev=672012&view=rev
Log:
fix 45195

Modified:
    tomcat/tc6.0.x/trunk/STATUS.txt
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
    tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=672012&r1=672011&r2=672012&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Thu Jun 26 12:48:30 2008
@@ -41,14 +41,6 @@
   +1: markt, remm, fhanik
   -1: 
 
-* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45195
-  NPE when calling getAttribute(null). The spec is unclear but this
-  is a regression from 5.0.x. Also avoid NPE on remove.
-  http://svn.apache.org/viewvc?rev=667604&view=rev
-  http://svn.apache.org/viewvc?rev=668854&view=rev
-  +1: markt, remm, fhanik
-  -1: 
-
 * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45212
   Map.entrySet() should return entries, not values
   http://svn.apache.org/viewvc?rev=668849&view=rev

Modified: 
tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java?rev=672012&r1=672011&r2=672012&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java 
(original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/StandardSession.java 
Thu Jun 26 12:48:30 2008
@@ -1032,6 +1032,8 @@
             throw new IllegalStateException
                 (sm.getString("standardSession.getAttribute.ise"));
 
+        if (name == null) return null;
+
         return (attributes.get(name));
 
     }
@@ -1634,6 +1636,9 @@
      */
     protected void removeAttributeInternal(String name, boolean notify) {
 
+        // Avoid NPE
+        if (name == null) return;
+
         // Remove this attribute from our collection
         Object value = attributes.remove(name);
 

Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=672012&r1=672011&r2=672012&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Thu Jun 26 12:48:30 2008
@@ -35,6 +35,9 @@
 <section name="Tomcat 6.0.17 (remm)">
   <subsection name="Catalina">
     <changelog>
+      <fix><bug>45195</bug>
+        Passing in null into setAttribute or removeAttribute cause NPE
+      </fix>
       <fix>
         APR connector now adds connection to poller after using send file 
(remm)
       </fix>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to