]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not allow empty IP addresses to be parsed
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 Mar 2016 15:56:17 +0000 (15:56 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 9 Mar 2016 15:56:17 +0000 (15:56 +0000)
src/libutil/addr.c

index 414c485385826bf728d8a29339b68f7d53e0ffbe..2a859252f8b24c99f0ffbaab71f76936c973bb41 100644 (file)
@@ -602,7 +602,7 @@ rspamd_parse_inet_address (rspamd_inet_addr_t **target,
                                /* Not ipv6, so try ip:port */
                                iplen = end - src;
 
-                               if (iplen > sizeof (ipbuf)) {
+                               if (iplen > sizeof (ipbuf) || iplen <= 1) {
                                        return FALSE;
                                }
                                else {