james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1079304 - /james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
Date Tue, 08 Mar 2011 09:23:41 GMT
Author: felixk
Date: Tue Mar  8 09:23:41 2011
New Revision: 1079304

URL: http://svn.apache.org/viewvc?rev=1079304&view=rev
Log:
Check for null value to prevent NPE

Modified:
    james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java

Modified: james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java?rev=1079304&r1=1079303&r2=1079304&view=diff
==============================================================================
--- james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
(original)
+++ james/protocols/trunk/smtp/src/main/java/org/apache/james/protocols/smtp/core/fastfail/DNSRBLHandler.java
Tue Mar  8 09:23:41 2011
@@ -81,11 +81,13 @@ public class DNSRBLHandler implements  C
      * @param whitelist The array which contains the whitelist
      */
     public void setWhitelist(String[] whitelist) {
-        // We need to copy the String array becuase of possible security issues.
+        // We need to copy the String array because of possible security issues.
         // Similar to https://issues.apache.org/jira/browse/PROTOCOLS-18
-        this.whitelist = new String[whitelist.length];
-        for (int i = 0; i < whitelist.length; i++) {
-            this.whitelist[i] = new String(whitelist[i]);
+        if (whitelist != null) {
+            this.whitelist = new String[whitelist.length];
+            for (int i = 0; i < whitelist.length; i++) {
+                this.whitelist[i] = new String(whitelist[i]);
+            }
         }
         this.whitelist = whitelist;
     }
@@ -96,11 +98,13 @@ public class DNSRBLHandler implements  C
      * @param blacklist The array which contains the blacklist
      */
     public void setBlacklist(String[] blacklist) {
-        // We need to copy the String array becuase of possible security issues.
+        // We need to copy the String array because of possible security issues.
         // Similar to https://issues.apache.org/jira/browse/PROTOCOLS-18
-        this.blacklist = new String[blacklist.length];
-        for (int i = 0; i < blacklist.length; i++) {
-            this.blacklist[i] = new String(blacklist[i]);
+        if (blacklist != null) {
+            this.blacklist = new String[blacklist.length];
+            for (int i = 0; i < blacklist.length; i++) {
+                this.blacklist[i] = new String(blacklist[i]);
+            }
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message