Fixes eventual buffer overrun in tee-supplicant
Fixes eventual buffer overrun in tee-supplicant

In the function tee_supp_fs_create_fname(...) you could overwrite the
out buffer. Now we take into account how much data the string
TEE_FS_PATH takes. To support this we let the caller tell the size of
the out buffer it provides instead of assuming that the parameter "out"
always has the size PATH_MAX.

Also did some minor clarifications in the tee_supp_fs_rename(...)
function to make it more understandable.

Signed-off-by: Joakim Bech <741f90e2a7f4d9afbad8bd50be20560f4cf38962@linaro.org>
Tested-by: Joakim Bech <741f90e2a7f4d9afbad8bd50be20560f4cf38962@linaro.org> (QEMU)
Reviewed-by: Jens Wiklander <7706914404370d7502c27a0eff493dcf491feb51@linaro.org>
Reviewed-by: Pascal Brand <0b55292d2562685bad4ce52d64f802e8f1cd299e@linaro.org>

pascal-brand-st-dev/optee_client,prime-zeng/optee_client,cedric-chaumont-st-dev/optee_client