summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-05-02 20:54:56 +0300
committerAndrei Karas <akaras@inbox.ru>2018-05-02 20:54:56 +0300
commit6e00588ebfe9441f793c304d42cf3c83463abe0c (patch)
tree193104da0512521ffa939e2b4dc5bf927794bb11 /src/common/utils.c
parent0622261073b6f4f0160cb0df150d3e07483d9b1b (diff)
downloadhercules-6e00588ebfe9441f793c304d42cf3c83463abe0c.tar.gz
hercules-6e00588ebfe9441f793c304d42cf3c83463abe0c.tar.bz2
hercules-6e00588ebfe9441f793c304d42cf3c83463abe0c.tar.xz
hercules-6e00588ebfe9441f793c304d42cf3c83463abe0c.zip
Fix possible buffer overflow in common.
Diffstat (limited to 'src/common/utils.c')
-rw-r--r--src/common/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/utils.c b/src/common/utils.c
index 0d76a885e..74c44d147 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -216,7 +216,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*))
if (strcmp(entry->d_name, "..") == 0)
continue;
- sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name);
+ safesnprintf(tmppath, sizeof(tmppath), "%s%c%s", path, PATHSEP, entry->d_name);
// check if the pattern matches.
if (strstr(entry->d_name, pattern)) {