diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-21 22:13:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-21 22:13:18 +0100 |
commit | 59327e94c21c64bc5b2aa7d35d978fefe40dadb5 (patch) | |
tree | eb575a39089bc570ca13a3726b4011c3a0c7f33d /src | |
parent | 6c62e78180c5dd39e7f3ef02eefc2751c3963926 (diff) | |
download | rspamd-59327e94c21c64bc5b2aa7d35d978fefe40dadb5.tar.gz rspamd-59327e94c21c64bc5b2aa7d35d978fefe40dadb5.zip |
Feed undefined behaviour.
Diffstat (limited to 'src')
-rw-r--r-- | src/libutil/map.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c index afb31c953..72f3a78b3 100644 --- a/src/libutil/map.c +++ b/src/libutil/map.c @@ -422,19 +422,18 @@ rspamd_map_remove_all (struct rspamd_config *cfg) gboolean rspamd_map_check_proto (const gchar *map_line, gint *res, const gchar **pos) { + g_assert (res != NULL); + g_assert (pos != NULL); + if (g_ascii_strncasecmp (map_line, "http://", - sizeof ("http://") - 1) == 0) { - if (res && pos) { - *res = MAP_PROTO_HTTP; - *pos = map_line + sizeof ("http://") - 1; - } + sizeof ("http://") - 1) == 0) { + *res = MAP_PROTO_HTTP; + *pos = map_line + sizeof ("http://") - 1; } else if (g_ascii_strncasecmp (map_line, "file://", sizeof ("file://") - - 1) == 0) { - if (res && pos) { - *res = MAP_PROTO_FILE; - *pos = map_line + sizeof ("file://") - 1; - } + 1) == 0) { + *res = MAP_PROTO_FILE; + *pos = map_line + sizeof ("file://") - 1; } else if (*map_line == '/') { /* Trivial file case */ |