From 4583d2d800647968bda8789b0a6ce00a25ce9f26 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 21 Mar 2015 21:55:28 +0000 Subject: [PATCH] testpanel: fix crash for short log lines And correctly highlight test failures --- src/bin/edi_consolepanel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bin/edi_consolepanel.c b/src/bin/edi_consolepanel.c index 9e2c97b..579c091 100644 --- a/src/bin/edi_consolepanel.c +++ b/src/bin/edi_consolepanel.c @@ -209,6 +209,8 @@ _edi_test_line_contains(const char *start, unsigned int length, const char *need ptr = (char *) start; needlelen = strlen(needle); + if (needlelen > length) + return EINA_FALSE; for (c = 0; c < length - strlen(needle); c++) { @@ -282,7 +284,7 @@ _edi_testpanel_line_cb(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, if (!strcmp(_EDI_SUITE_PASSED, line->data)) line->status = ELM_CODE_STATUS_TYPE_PASSED; - else if (!strcmp(_EDI_SUITE_FAILED, line->data)) + else line->status = ELM_CODE_STATUS_TYPE_FAILED; return EO_CALLBACK_CONTINUE;