aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/addr.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-19 12:34:29 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-19 12:34:29 +0000
commit970a8f6bf3b0f0b601567483c29f91af72d99008 (patch)
tree0779bff186e9b4bcf1ec714b9ac79b7d52f111fe /src/libutil/addr.c
parent27f77e95e672dbbf34141a5e6aa4d21e8d929702 (diff)
downloadrspamd-970a8f6bf3b0f0b601567483c29f91af72d99008.tar.gz
rspamd-970a8f6bf3b0f0b601567483c29f91af72d99008.zip
Do not use 'strchr' on rspamd_fstring_t
Diffstat (limited to 'src/libutil/addr.c')
-rw-r--r--src/libutil/addr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/addr.c b/src/libutil/addr.c
index 167bd8094..2b5ca9854 100644
--- a/src/libutil/addr.c
+++ b/src/libutil/addr.c
@@ -562,7 +562,7 @@ rspamd_parse_inet_address (rspamd_inet_addr_t **target,
if (src[0] == '[') {
/* Ipv6 address in format [::1]:port or just [::1] */
- end = strrchr (src + 1, ']');
+ end = memchr (src + 1, ']', srclen - 1);
if (end == NULL) {
return FALSE;
@@ -593,7 +593,7 @@ rspamd_parse_inet_address (rspamd_inet_addr_t **target,
}
else {
- if ((end = strchr (src, ':')) != NULL) {
+ if ((end = memchr (src, ':', srclen)) != NULL) {
/* This is either port number and ipv4 addr or ipv6 addr */
if (ipv6_status == RSPAMD_IPV6_SUPPORTED &&
rspamd_parse_inet_address_ip6 (src, srclen, &su.s6.sin6_addr)) {