All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test-common: Avoid accessing an unitialised variable.
@ 2010-06-21  8:41 Andrzej Zaborowski
  2010-06-21  8:41 ` [PATCH] stkutil: Remove obsolete comment Andrzej Zaborowski
  2010-06-21 21:11 ` [PATCH] test-common: Avoid accessing an unitialised variable Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Andrzej Zaborowski @ 2010-06-21  8:41 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 657 bytes --]

Fixes a segfault, reported by valrgind as:
[...]
==6300== Use of uninitialised value of size 4
==6300==    at 0x8048B4D: test_invalid (test-common.c:81)
---
 unit/test-common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/unit/test-common.c b/unit/test-common.c
index f33f117..baed178 100644
--- a/unit/test-common.c
+++ b/unit/test-common.c
@@ -78,7 +78,7 @@ static void test_invalid()
 
 		ret = parse_ss_control_string(str, &type, &sc,
 						&sia, &sib, &sic, &sid, &dn);
-		if (strlen(sid))
+		if (ret == TRUE && strlen(sid))
 			ret = FALSE;
 
 		g_assert(ret == FALSE);
-- 
1.7.1.86.g0e460.dirty


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-06-21 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-21  8:41 [PATCH] test-common: Avoid accessing an unitialised variable Andrzej Zaborowski
2010-06-21  8:41 ` [PATCH] stkutil: Remove obsolete comment Andrzej Zaborowski
2010-06-21 21:11   ` Denis Kenzior
2010-06-21 21:11 ` [PATCH] test-common: Avoid accessing an unitialised variable Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.