diff src/dnsbl.cpp @ 266:582cfb9c4031 stable-6-0-33

fix unauthenticated rate limit bug for empty mail from
author Carl Byington <carl@five-ten-sg.com>
date Sat, 21 Jul 2012 13:05:54 -0700
parents e118fd2c6af0
children f941563c2a95
line wrap: on
line diff
--- a/src/dnsbl.cpp	Sat Jul 21 12:47:19 2012 -0700
+++ b/src/dnsbl.cpp	Sat Jul 21 13:05:54 2012 -0700
@@ -1051,11 +1051,13 @@
 //
 const char *to_lower_string(const char *email);
 const char *to_lower_string(const char *email) {
+    if (!email) return strdup("<>");
     int n = strlen(email);
+    if (n == 0) return strdup("<>");
     if (email[0] == '<') {
         // assume it also ends with >
         n -= 2;
-        if (n < 1) return strdup(email);    // return "<>"
+        if (n < 1) return strdup("<>");
         email++;
     }
     if ((email[0] == '\'') && (email[n-1] == '\'') && (n > 2)) {