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
This commit is contained in:
Stefan Schmidt 2020-02-12 12:10:04 -05:00 committed by Mike Blumenkrantz
parent 9510702ede
commit bf2b9adec5
1 changed files with 2 additions and 1 deletions

View File

@ -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++)