Skip to contentSkip to conversation

test-common: Avoid accessing an unitialised variable.

PATCH In review Andrzej Zaborowski 2 participants 4 messages Jun 21, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test-common: Avoid accessing an unitialised variable.

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(-)
unit/test-common.c +1 -1
index f33f117..baed178 100644
@@ -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);
Signature · 1 line
1.7.1.86.g0e460.dirty
#1 lore raw

PATCH 1/1 stkutil: Remove obsolete comment.

---
 src/stkutil.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
src/stkutil.c +0 -3
index 642081e..6520c8a 100644
@@ -4541,9 +4541,6 @@ static gboolean build_dataobj_bcch_channel_list(struct stk_tlv_builder *tlv,
 	unsigned int i, bytes, pos, shift;
 	unsigned char value;
 
-	/* To distinguish between no BCCH Channel List data object and
-	 * an empty object in a sequence of empty and non-empty objects,
-	 * .channels must be non-NULL in objects in sequences.  */
 	if (list->has_list == FALSE)
 		return TRUE;
 
Signature · 1 line
1.7.1.86.g0e460.dirty
#2 lore raw

Re: [PATCH] stkutil: Remove obsolete comment.

Hi Andrew,

Quoted 3 lines
---
 src/stkutil.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Patch has been applied, thanks.

Regards,
-Denis

#3 lore raw
In reply to Andrzej Zaborowski

Hi Andrew,

Quoted 7 lines

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(-)

Good catch. Patch has been applied.

Regards,
-Denis