From 6e00588ebfe9441f793c304d42cf3c83463abe0c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 2 May 2018 20:54:56 +0300 Subject: Fix possible buffer overflow in common. --- src/common/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/common/utils.c') 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)) { -- cgit v1.2.3-60-g2f50