public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix initgrcache.c
@ 2006-09-05 10:28 Jakub Jelinek
  2006-09-05 14:36 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2006-09-05 10:28 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

If malloc fails, it will goto out and use there an uninitialized
any_success variable.

2006-09-05  Jakub Jelinek  <jakub@redhat.com>

	* 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

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

* Re: [PATCH] Fix initgrcache.c
  2006-09-05 10:28 [PATCH] Fix initgrcache.c Jakub Jelinek
@ 2006-09-05 14:36 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2006-09-05 14:36 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

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

Applied.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

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

end of thread, other threads:[~2006-09-05 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-05 10:28 [PATCH] Fix initgrcache.c Jakub Jelinek
2006-09-05 14:36 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).