geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r669143 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
Date Wed, 18 Jun 2008 12:10:28 GMT
Author: rickmcguire
Date: Wed Jun 18 05:10:28 2008
New Revision: 669143

URL: http://svn.apache.org/viewvc?rev=669143&view=rev
Log:
GERONIMO-4126 NPE if null argument specified for InternetHeaders.getMatchingHeaders()

Problem uncovered by running with James test cases. 


Modified:
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java?rev=669143&r1=669142&r2=669143&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/InternetHeaders.java
Wed Jun 18 05:10:28 2008
@@ -469,6 +469,12 @@
      *         for a complete mismatch.
      */
     private boolean matchHeader(String name, String[] names) {
+        // the list of names is not required, so treat this as if it 
+        // was an empty list and we didn't get a match. 
+        if (names == null) {
+            return false; 
+        }
+        
         for (int i = 0; i < names.length; i++) {
             if (name.equalsIgnoreCase(names[i])) {
                 return true;



Mime
View raw message