aboutsummaryrefslogtreecommitdiffstats
path: root/src/dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns.c')
-rw-r--r--src/dns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dns.c b/src/dns.c
index 5197aae66..c50b9f388 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -771,7 +771,7 @@ dns_parse_rr (guint8 *in, union rspamd_reply_element *elt, guint8 **pos, struct
msg_info ("bad RR name");
return -1;
}
- if (p - *pos >= *remain - sizeof (guint16) * 5) {
+ if (p - *pos >= *remain - sizeof (guint16) * 5 || *remain <= 0) {
msg_info ("stripped dns reply");
return -1;
}