From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21199 invoked by alias); 5 Sep 2006 10:28:14 -0000 Received: (qmail 21183 invoked by uid 22791); 5 Sep 2006 10:28:14 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Sep 2006 10:28:12 +0000 Received: from sunsite.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.1/8.13.1) with ESMTP id k85ARqQk011452; Tue, 5 Sep 2006 12:27:52 +0200 Received: (from jj@localhost) by sunsite.mff.cuni.cz (8.13.1/8.13.1/Submit) id k85ARpdS011449; Tue, 5 Sep 2006 12:27:51 +0200 Date: Tue, 05 Sep 2006 10:28:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix initgrcache.c Message-ID: <20060905102751.GS4556@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00002.txt.bz2 Hi! If malloc fails, it will goto out and use there an uninitialized any_success variable. 2006-09-05 Jakub Jelinek * nscd/initgrcache.c (addinitgroupsX): Move any_success decl before first goto out. --- libc/nscd/initgrcache.c.jj 2006-08-03 19:36:25.000000000 +0200 +++ libc/nscd/initgrcache.c 2006-09-05 12:20:29.000000000 +0200 @@ -107,6 +107,7 @@ addinitgroupsX (struct database_dyn *db, long int start = 0; bool all_tryagain = true; + bool any_success = false; /* This is temporary memory, we need not (ad must not) call mempool_alloc. */ @@ -117,7 +118,6 @@ addinitgroupsX (struct database_dyn *db, goto out; /* Nothing added yet. */ - bool any_success = false; while (! no_more) { long int prev_start = start; Jakub