[PATCH] talloc: Fix the O3 developer build

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 12 10:09:11 UTC 2015


Hi!

Review&push appreciated!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 63a742f21519a52de70df2eb9568d1a5befdfbf9 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 12 Oct 2015 12:06:50 +0200
Subject: [PATCH] talloc: Fix the O3 developer build

Compilers can't see that the child exits. Thus "exit_status" is
used uninitialized in the child.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 lib/talloc/testsuite.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index 9f83039..34410b8 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -1895,10 +1895,13 @@ static bool test_magic_protection(void)
 
 		/* Then the attack takes effect when the memory's freed. */
 		talloc_free(pool);
-	} else {
-		while (wait(&exit_status) != pid);
+
+		/* Never reached. Make compilers happy */
+		return true;
 	}
 
+	while (wait(&exit_status) != pid);
+
 	if (!WIFEXITED(exit_status)) {
 		printf("Child exited through unexpected abnormal means\n");
 		return false;
-- 
2.6.0



More information about the samba-technical mailing list