diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-04 20:31:24 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-04 20:31:24 +0400 |
commit | 3f96e6a7a317e70b85b32de4aa06681c11d79006 (patch) | |
tree | 70343e3fb1a43d29d9c4f454fa47b2dcad6249ad /src/dns.c | |
parent | 6b86782ce21caad081d41f54ef10233a8e757189 (diff) | |
download | rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip |
Fix signness in arithmetic operations.
Diffstat (limited to 'src/dns.c')
-rw-r--r-- | src/dns.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -770,7 +770,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 || *remain <= 0) { + if ((gint)(p - *pos) >= (gint)(*remain - sizeof (guint16) * 5) || *remain <= 0) { msg_info ("stripped dns reply"); return -1; } @@ -875,7 +875,7 @@ dns_parse_rr (guint8 *in, union rspamd_reply_element *elt, guint8 **pos, struct p += datalen; } else { - if (p - *pos > *remain - sizeof (guint16) * 3) { + if (p - *pos > (gint)(*remain - sizeof (guint16) * 3)) { msg_info ("stripped dns reply while reading SRV record"); return -1; } @@ -938,10 +938,6 @@ dns_parse_reply (guint8 *in, gint r, struct rspamd_dns_resolver *resolver, return FALSE; } /* - * Remove delayed retransmits for this packet - */ - event_del (&req->timer_event); - /* * Now pos is in answer section, so we should extract data and form reply */ rep = memory_pool_alloc (req->pool, sizeof (struct rspamd_dns_reply)); @@ -1009,7 +1005,7 @@ dns_read_cb (gint fd, short what, void *arg) /* First read packet from socket */ r = read (fd, in, sizeof (in)); - if (r > sizeof (struct dns_header) + sizeof (struct dns_query)) { + if (r > (gint)(sizeof (struct dns_header) + sizeof (struct dns_query))) { if (dns_parse_reply (in, r, resolver, &req, &rep)) { /* Decrease errors count */ if (rep->request->resolver->errors > 0) { |