From 1bdd6b9b770fe11c3167e3365b236041a2f5582a Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 2 May 2014 12:59:29 +0100 Subject: Fix dirname(3) usage. --- src/libutil/http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3