regression_8100: use null terminated strings with file_to_c

GCC 9 is more strict with string manipulation, causing the build to
fail as the string data converted via file_to_c is not null terminated,
as described by the following build error:

regression_8100.c:100:29: error: '%*s' directive argument is not a
nul-terminated string [-Werror=format-overflow=]
tlen = myasprintf(&trust, "%*s", (int)sizeof(regression_8100_ca_crt),
                           ^~~
      regression_8100_ca_crt);
      ~~~~~~~~~~~~~~~~~~~~~~

Change file_to_c to terminate the string after conversion and update the
string size to remove the null terminated byte. Also update
regression_8100 to use the size variable defined via file_to_c instead
of manually calling sizeof.

Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
2 files changed
tree: f65bcef5ea9fb06c9e442cf1e3b2b0d69dbaef82
  1. cert/
  2. host/
  3. package/
  4. scripts/
  5. ta/
  6. .gitignore
  7. Android.mk
  8. CMakeLists.txt
  9. CMakeToolchain.txt
  10. LICENSE.md
  11. Makefile
  12. README.md
README.md

OP-TEE sanity testsuite

This git contains source code for the test suite (xtest) used to test the OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io. The information that used to be here in this git can be found under optee_test.

// OP-TEE core maintainers