exactness: limit length for font_path to stay in buffer

We get fonts_dir from a getenv() without and length check. Make sure
that we stay in the given buffer size when stitching the file path
together.

CID: 1422195

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11718
This commit is contained in:
Stefan Schmidt 2020-04-16 16:25:29 +02:00
parent 95bff0fac9
commit 61599d67ed
1 changed files with 1 additions and 1 deletions

View File

@ -956,7 +956,7 @@ _setup_font_settings(const char *fonts_dir)
{
char buf[PATH_MAX];
if (!fonts_dir) fonts_dir = "./fonts";
sprintf(buf, "%s/%s", fonts_dir, _src_unit->fonts_path);
snprintf(buf, PATH_MAX, "%s/%s", fonts_dir, _src_unit->fonts_path);
if (!ecore_file_exists(buf))
{
fprintf(stderr, "Unable to use the fonts path '%s' provided in %s\n",