]> source.dussan.org Git - rspamd.git/commitdiff
* Fix assertion while extracting internet address
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 26 Aug 2010 11:04:07 +0000 (15:04 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 26 Aug 2010 11:04:07 +0000 (15:04 +0400)
src/expressions.c

index c009ddc84fd670d4f0c52de476050aa3cf313510..d6e6647f19938559bbe483319161c421bfbfbb6c 100644 (file)
@@ -1359,14 +1359,16 @@ is_recipient_list_sorted (const InternetAddressList * ia)
        cur = ia;
        while (cur) {
                addr = internet_address_list_get_address (cur);
-               current.addr = internet_address_get_addr (addr);
-               if (previous.addr != NULL) {
-                       if (current.addr && g_ascii_strcasecmp (current.addr, previous.addr) < 0) {
-                               res = FALSE;
-                               break;
+               if (internet_address_get_type (addr) == INTERNET_ADDRESS_NAME) {
+                       current.addr = internet_address_get_addr (addr);
+                       if (previous.addr != NULL) {
+                               if (current.addr && g_ascii_strcasecmp (current.addr, previous.addr) < 0) {
+                                       res = FALSE;
+                                       break;
+                               }
                        }
+                       previous.addr = current.addr;
                }
-               previous.addr = current.addr;
                cur = internet_address_list_next (cur);
        }
 #endif