diff options
author | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2019-08-11 16:35:03 +0100 |
---|---|---|
committer | Carsten Haitzler (Rasterman) <raster@rasterman.com> | 2019-08-11 16:35:03 +0100 |
commit | 0a06c7b5683173525ef7643d1a5f8c056afc4152 (patch) | |
tree | e0d53341f16b6d87da2f945b9bde0f5f5a5c7365 | |
parent | cb513df3775ce5e4d8fa40b9981a0944bfca4598 (diff) | |
download | efl-0a06c7b5683173525ef7643d1a5f8c056afc4152.tar.gz |
efl check - use global not stack local buffer for srunner_set_xml
asan is most unhappy about using a priori stack frame's data for
this.. it seems check uses the char * buf directly as-is without
duplicating it... so we can't sensibvly use local stack data. that is
what asan is saying... and this makes our tests not work under asan to
begin with... nto to mention other possible issues i have yet to see
as i got to this one first.
-rw-r--r-- | src/tests/efl_check.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/tests/efl_check.h b/src/tests/efl_check.h index 2738f51db0..abb114e005 100644 --- a/src/tests/efl_check.h +++ b/src/tests/efl_check.h @@ -249,6 +249,8 @@ _timing_end(void) #endif +static char srunner_xml_buf[4096]; + static int _efl_suite_run_end(SRunner *sr, const char *name) { @@ -257,7 +259,7 @@ _efl_suite_run_end(SRunner *sr, const char *name) if (name) { char *n = strdup(name); - char buf[4096], *p; + char *p; for (p = n; p[0]; p++) { @@ -271,8 +273,8 @@ _efl_suite_run_end(SRunner *sr, const char *name) break; } } - snprintf(buf, sizeof(buf), TESTS_BUILD_DIR "/check-results-%s.xml", n); - srunner_set_xml(sr, buf); + snprintf(srunner_xml_buf, sizeof(srunner_xml_buf), TESTS_BUILD_DIR "/check-results-%s.xml", n); + srunner_set_xml(sr, srunner_xml_buf); free(n); } else |