aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:59:29 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-05-02 12:59:29 +0100
commit1bdd6b9b770fe11c3167e3365b236041a2f5582a (patch)
treec9e7604bdfb6ff996b0837b520d775ce4e0190ec /src/libutil
parenta88f5138d62cded339e973a229fbcb07ade19247 (diff)
downloadrspamd-1bdd6b9b770fe11c3167e3365b236041a2f5582a.tar.gz
rspamd-1bdd6b9b770fe11c3167e3365b236041a2f5582a.zip
Fix dirname(3) usage.
Diffstat (limited to 'src/libutil')
-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;
}