diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-02 12:59:29 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-05-02 12:59:29 +0100 |
commit | 1bdd6b9b770fe11c3167e3365b236041a2f5582a (patch) | |
tree | c9e7604bdfb6ff996b0837b520d775ce4e0190ec /src/libutil | |
parent | a88f5138d62cded339e973a229fbcb07ade19247 (diff) | |
download | rspamd-1bdd6b9b770fe11c3167e3365b236041a2f5582a.tar.gz rspamd-1bdd6b9b770fe11c3167e3365b236041a2f5582a.zip |
Fix dirname(3) usage.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/http.c | 6 |
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; } |