diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-24 12:19:52 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-09-24 12:19:52 +0100 |
commit | 12df275efe7e4bd45c40c8287be587b422ea39ca (patch) | |
tree | 772b7fe3a06da00b32b1aaf2f524460e4f4adf07 | |
parent | 55aa9f063dfd50d5714f52a550d0b39cd6079fee (diff) | |
download | rspamd-12df275efe7e4bd45c40c8287be587b422ea39ca.tar.gz rspamd-12df275efe7e4bd45c40c8287be587b422ea39ca.zip |
Parse masks with a single number correctly.
-rw-r--r-- | src/spf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -314,7 +314,7 @@ parse_spf_ipmask (const gchar *begin, struct spf_addr *addr) if (state == 2) { /* Also parse mask */ if (!addr->data.normal.ipv6) { - addr->data.normal.mask = (mask_buf[0] - '0') * 10 + mask_buf[1] - '0'; + addr->data.normal.mask = strtoul (mask_buf, NULL, 10); if (addr->data.normal.mask > 32) { msg_info ("bad ipmask value: '%s'", begin); return FALSE; |