exactness: handbuild a new argv array instead of reassemling the new one
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Wed, 25 Mar 2020 14:24:09 +0000 (15:24 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Thu, 26 Mar 2020 21:03:19 +0000 (06:03 +0900)
commit62b1ae76624762d93a80e635570ffae5cf9951a0
tree01e4699480f0832735f89ee990e6988f2790f037
parent5b34b2dcd9409cb8cdd2282f340d8d9581fc42a3
exactness: handbuild a new argv array instead of reassemling the new one

this commit removes the code that was changing argv values, and replaces
it with a new array. Which is absolutly fine, as the argv / argc values
are never accessed later on. Only the copies that have been passed to
efl_main or elm_main.

This resolves several issues:
1. the for loop is useless, every single array element that gets
   initialized with it, is some offset from argv[0] this may also crash
   when argv[i] - argv[opt_args] is bigger strlen argv[0].
2. The memcpy here is super dangerous, the dest array is not garanteed
   to have the same size as argv[0], this only works if the client
   application name is shorter than the name "exactness_recorder"
3. The memset here is absolutly wrong. There is again no garantee that
   the array has the expected size behind that, this was constantly
   overwriting the segment after the place where argv was stored, which
   was lukely enough on fedora always the environs, which deleted the
   couple first segments. (This was not causing any fuzz, since they
   have been sudo related env vars on the docker image). However, on
   arch this just crashed right away. On Ubuntu this overwrote DISPLAY,
   which resulted in the unability to launch the app.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11600
src/bin/exactness/player.c
src/bin/exactness/recorder.c