asdfuser pushed a commit to branch master.
commit 0e51bff61ac4678ab75384d704141f49c87f352b
Author: Daniel Willmann <[email protected]>
Date: Wed Jun 12 23:57:42 2013 +0100
eina_test_str: Make sure we have an empty string before using strcat
Caused issues with address sanitizer. Just calling allocating memory for
a string does not mean that it's empty/NULL-terminated.
---
src/tests/eina/eina_test_str.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/tests/eina/eina_test_str.c b/src/tests/eina/eina_test_str.c
index b4c3660..1d95f21 100644
--- a/src/tests/eina/eina_test_str.c
+++ b/src/tests/eina/eina_test_str.c
@@ -166,6 +166,7 @@ START_TEST(str_split)
free(result);
str = malloc(sizeof(char) * 1024);
+ str[0] = 0;
for (elements = 0; elements < 300; elements++)
strcat(str, "ma:");
strcat(str, "ma");
--
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev