diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-28 11:08:14 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-28 11:08:14 +0000 |
commit | 8beb6fe20a322fe72faaabf8507503f138dbeb73 (patch) | |
tree | 7364db81d8e8f9b1421cf51923130de30904d5d4 /src/libserver | |
parent | 51319cbd3cf0050add4d7743653eb2626784f7bd (diff) | |
download | rspamd-8beb6fe20a322fe72faaabf8507503f138dbeb73.tar.gz rspamd-8beb6fe20a322fe72faaabf8507503f138dbeb73.zip |
Fix dereferencing of NULL pointer.
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/roll_history.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libserver/roll_history.c b/src/libserver/roll_history.c index 2f5c5ddb3..c494ce74c 100644 --- a/src/libserver/roll_history.c +++ b/src/libserver/roll_history.c @@ -109,9 +109,15 @@ rspamd_roll_history_update (struct roll_history *history, } /* 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 */ |