summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-05-06 17:52:22 +0200
committerGitHub <noreply@github.com>2018-05-06 17:52:22 +0200
commitb889108f6dea3e1765681b9eaf4a39a18c24eeec (patch)
tree40e2b55d2e4d1f4a38a0a36be7f9920dd9637ce4 /src/common/utils.c
parentd6785d389cbee4f34078f6762626ca61b2d6cc25 (diff)
parented8fac40e2d6cbf11b9a4a1a8182cd28871e3e6d (diff)
downloadhercules-b889108f6dea3e1765681b9eaf4a39a18c24eeec.tar.gz
hercules-b889108f6dea3e1765681b9eaf4a39a18c24eeec.tar.bz2
hercules-b889108f6dea3e1765681b9eaf4a39a18c24eeec.tar.xz
hercules-b889108f6dea3e1765681b9eaf4a39a18c24eeec.zip
Merge pull request #2028 from 4144/warnings
Fix some possible buffer overflows.
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)) {