public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix 2 issues found by valgrind
@ 2004-11-29 17:59 Jakub Jelinek
  2004-12-01 19:56 ` Roland McGrath
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2004-11-29 17:59 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

1) in internal_fnmatch we have is_seqval is uninitialized
   after we goto to normal_bracket, as we jump into the
   middle of is_seqval's scope, don't set it to anything
   and later on use it
2) tst-mktime2.c did not initialize tm.tm_isdst, yet mktime
   uses this

Will keep looking at other problems.

2004-11-29  Jakub Jelinek  <jakub@redhat.com>

	* posix/fnmatch_loop.c (internal_fnmatch): Clear is_seqval after
	normal_bracket label.

	* time/tst-mktime2.c (bigtime_test): Initialize tm.tm_isdst to -1.

--- libc/posix/fnmatch_loop.c.jj	2004-09-04 09:16:57.000000000 +0200
+++ libc/posix/fnmatch_loop.c	2004-11-29 17:32:06.284085221 +0100
@@ -600,6 +600,9 @@ FCT (pattern, string, string_end, no_lea
 			if (!is_range && c == fn)
 			  goto matched;
 
+			/* This is needed if we goto normal_bracket; from
+			   outside of is_seqval's scope.  */
+			is_seqval = 0;
 			cold = c;
 			c = *p++;
 		      }
--- libc/time/tst-mktime2.c.jj	2004-11-01 01:21:23.000000000 +0100
+++ libc/time/tst-mktime2.c	2004-11-29 15:01:24.509816991 +0100
@@ -78,6 +78,7 @@ bigtime_test (int j)
   struct tm tm;
   time_t now;
   tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
+  tm.tm_isdst = -1;
   now = mktime (&tm);
   if (now != (time_t) -1)
     {

	Jakub

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

end of thread, other threads:[~2004-12-01 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-29 17:59 [PATCH] Fix 2 issues found by valgrind Jakub Jelinek
2004-12-01 19:56 ` Roland McGrath
2004-12-01 21:19   ` Jakub Jelinek
2004-12-01 23:56     ` Roland McGrath

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