From bf2b9adec5453019e74b5c6418573d171a837114 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Wed, 12 Feb 2020 12:10:04 -0500 Subject: [PATCH] exactness_player: fix running of exactness player after compile fix Summary: The last compile fix broke the execution of exactness. When replacing _POSIX_PATH_MAX with PATH_MAX here we did not catch that it would overwrite out of bounds here as the original _POSIX_PATH_MAX is limited to 256 while PATH_MAX can go up to 4096. This screws up the size of the memset. Reviewers: zmike, bu5hm4n, vtorri, ali.alzyod Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11317 --- src/bin/exactness/player.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index 411b1a64cb..13de9bffe3 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -32,6 +32,7 @@ #include "exactness_private.h" #define PATH_ 1024 +#define CMD_LINE_MAX 256 #define IMAGE_FILENAME_EXT ".png" #define PAUSE_KEY_STR "F2" @@ -1282,7 +1283,7 @@ int main(int argc, char **argv) /* Replace the current command line to hide the Exactness part */ int len = argv[argc - 1] + strlen(argv[argc - 1]) - argv[opt_args]; memcpy(argv[0], argv[opt_args], len); - memset(argv[0] + len, 0, PATH_MAX - len); + memset(argv[0] + len, 0, CMD_LINE_MAX - len); int i; for (i = opt_args; i < argc; i++)