aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libutil/http.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/http.c b/src/libutil/http.c
index 5bafc91cd..22f870262 100644
--- a/src/libutil/http.c
+++ b/src/libutil/http.c
@@ -1084,9 +1084,9 @@ rspamd_http_router_try_file (struct rspamd_http_connection_entry *entry,
}
/* We also need to ensure that file is inside the defined dir */
- dir = dirname (realbuf);
- if (dir == NULL || strncmp (dir, entry->rt->default_fs_path,
- strlen (entry->rt->default_fs_path)) != 0) {
+ rspamd_strlcpy (filebuf, realbuf, sizeof (filebuf));
+ dir = dirname (filebuf);
+ if (dir == NULL || strcmp (dir, entry->rt->default_fs_path) != 0) {
return FALSE;
}