}
/* Add information from task to roll history */
- rspamd_strlcpy (row->from_addr,
- rspamd_inet_address_to_string (task->from_addr),
- sizeof (row->from_addr));
+ if (task->from_addr) {
+ rspamd_strlcpy (row->from_addr,
+ rspamd_inet_address_to_string (task->from_addr),
+ sizeof (row->from_addr));
+ }
+ else {
+ rspamd_strlcpy (row->from_addr, "unknown", sizeof (row->from_addr));
+ }
+
memcpy (&row->tv, &task->tv, sizeof (row->tv));
/* Strings */
{
static char addr_str[INET6_ADDRSTRLEN + 1];
+ if (addr == NULL) {
+ return "<empty inet address>";
+ }
+
switch (addr->af) {
case AF_INET:
return inet_ntop (addr->af, &addr->u.in.addr.s4.sin_addr, addr_str,