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.
This commit is contained in:
Carsten Haitzler 2019-08-11 16:35:03 +01:00
parent cb513df377
commit 0a06c7b568
1 changed files with 5 additions and 3 deletions

View File

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