This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix uninitialized vars in ld-collate.c


Hi!

col_sym_free label is in a different block and frees what local variables
in that block point to, guess that's a typo.
seqp was declared in 2 different blocks and one was in some cases using
goto to jump to the other block.

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

	* locale/programs/ld-collate.c (collate_read): Goto sym_equiv_free rather than
	col_sym_free.  Move seqp declaration earlier.

--- libc/locale/programs/ld-collate.c.jj	2006-08-30 17:20:41.000000000 +0200
+++ libc/locale/programs/ld-collate.c	2006-09-06 18:33:31.000000000 +0200
@@ -3068,7 +3068,7 @@ collate_read (struct linereader *ldfile,
 		  lr_error (ldfile, _("\
 %s: unknown symbol `%s' in equivalent definition"),
 			    "LC_COLLATE", symname);
-		  goto col_sym_free;
+		  goto sym_equiv_free;
 		}
 
 	      if (insert_entry (&collate->sym_table,
@@ -3533,13 +3533,13 @@ error while adding equivalent collating 
 	      break;
 	    }
 
+	  struct element_t *seqp;
 	  if (state == 0)
 	    {
 	      /* We are outside an `order_start' region.  This means
                  we must only accept definitions of values for
                  collation symbols since these are purely abstract
                  values and don't need directions associated.  */
-	      struct element_t *seqp;
 	      void *ptr;
 
 	      if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0)
@@ -3586,7 +3586,6 @@ error while adding equivalent collating 
 	    {
 	      /* It is possible that we already have this collation sequence.
 		 In this case we move the entry.  */
-	      struct element_t *seqp = NULL;
 	      void *sym;
 	      void *ptr;
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]