if (types[i].isdst > 1) goto lose;
__tzfile_read (const char *file){  static const char default_tzdir[] = TZDIR;  size_t num_isstd, num_isgmt;  register FILE *f;  struct tzhead tzhead;  size_t chars;  register size_t i;  __use_tzfile = 0;  if (transitions != NULL)    free ((void *) transitions);  transitions = NULL;  if (type_idxs != NULL)    free ((void *) type_idxs);  type_idxs = NULL;  if (types != NULL)    free ((void *) types);  types = NULL;  if (zone_names != NULL)    free ((void *) zone_names);  zone_names = NULL;  if (leaps != NULL)    free ((void *) leaps);  leaps = NULL;  if (file == NULL)    /* No user specification; use the site-wide default.  */    file = TZDEFAULT;  else if (*file == '\0')    /* User specified the empty string; use UTC with no leap seconds.  */    return;  else    {      /* We must not allow to read an arbitrary file in a setuid	 program.  So we fail for any file which is not in the	 directory hierachy starting at TZDIR	 and which is not the system wide default TZDEFAULT.  */      if (__libc_enable_secure	  && ((*file == '/'	       && memcmp (file, TZDEFAULT, sizeof TZDEFAULT)	       && memcmp (file, default_tzdir, sizeof (default_tzdir) - 1))	      || strstr (file, "../") != NULL))	/* This test is certainly a bit too restrictive but it should	   catch all critical cases.  */	return;    }  if (*file != '/')    {      const char *tzdir;      unsigned int len, tzdir_len;      char *new, *tmp;      tzdir = __secure_getenv ("TZDIR");      if (tzdir == NULL || *tzdir == '\0')	{	  tzdir = default_tzdir;	  tzdir_len = sizeof (default_tzdir) - 1;	}      else	tzdir_len = strlen (tzdir);      len = strlen (file) + 1;      new = (char *) __alloca (tzdir_len + 1 + len);      tmp = __mempcpy (new, tzdir, tzdir_len);      *tmp++ = '/';      __mempcpy (tmp, file, len);      file = new;    }  f = fopen (file, "r");  if (f == NULL)    return;  if (fread_unlocked ((void *) &tzhead, sizeof (tzhead), 1, f) != 1)    goto lose;  num_transitions = (size_t) decode (tzhead.tzh_timecnt);  num_types = (size_t) decode (tzhead.tzh_typecnt);  chars = (size_t) decode (tzhead.tzh_charcnt);  num_leaps = (size_t) decode (tzhead.tzh_leapcnt);  num_isstd = (size_t) decode (tzhead.tzh_ttisstdcnt);  num_isgmt = (size_t) decode (tzhead.tzh_ttisgmtcnt);  if (num_transitions > 0)    {      transitions = (time_t *) malloc (num_transitions * sizeof (time_t));      if (transitions == NULL)	goto lose;      type_idxs = (unsigned char *) malloc (num_transitions);      if (type_idxs == NULL)	goto lose;    }  if (num_types > 0)    {      types = (struct ttinfo *) malloc (num_types * sizeof (struct ttinfo));      if (types == NULL)	goto lose;    }  if (chars > 0)    {      zone_names = (char *) malloc (chars);      if (zone_names == NULL)	goto lose;    }  if (num_leaps > 0)    {      leaps = (struct leap *) malloc (num_leaps * sizeof (struct leap));      if (leaps == NULL)	goto lose;    }  if (sizeof (time_t) < 4)      abort ();  if (fread_unlocked (transitions, 4, num_transitions, f) != num_transitions      || fread_unlocked (type_idxs, 1, num_transitions, f) != num_transitions)    goto lose;  /* Check for bogus indices in the data file, so we can hereafter     safely use type_idxs[T] as indices into `types' and never crash.  */  for (i = 0; i < num_transitions; ++i)    if (type_idxs[i] >= num_types)      goto lose;  if (BYTE_ORDER != BIG_ENDIAN || sizeof (time_t) != 4)    {      /* Decode the transition times, stored as 4-byte integers in	 network (big-endian) byte order.  We work from the end of	 the array so as not to clobber the next element to be	 processed when sizeof (time_t) > 4.  */      i = num_transitions;      while (i-- > 0)	transitions[i] = decode ((char *) transitions + i * 4);    }  for (i = 0; i < num_types; ++i)    {      unsigned char x[4];      if (fread_unlocked (x, 1, 4, f) != 4	  || fread_unlocked (&types[i].isdst, 1, 1, f) != 1	  || fread_unlocked (&types[i].idx, 1, 1, f) != 1)	goto lose;      if (types[i].idx >= chars) /* Bogus index in data file.  */	goto lose;      types[i].offset = (long int) decode (x);    }  if (fread_unlocked (zone_names, 1, chars, f) != chars)    goto lose;  for (i = 0; i < num_leaps; ++i)    {      unsigned char x[4];      if (fread_unlocked (x, 1, sizeof (x), f) != sizeof (x))	goto lose;      leaps[i].transition = (time_t) decode (x);      if (fread_unlocked (x, 1, sizeof (x), f) != sizeof (x))	goto lose;      leaps[i].change = (long int) decode (x);    }  for (i = 0; i < num_isstd; ++i)    {      int c = getc_unlocked (f);      if (c == EOF)	goto lose;      types[i].isstd = c != 0;    }  while (i < num_types)    types[i++].isstd = 0;  for (i = 0; i < num_isgmt; ++i)    {      int c = getc_unlocked (f);      if (c == EOF)	goto lose;      types[i].isgmt = c != 0;    }  while (i < num_types)    types[i++].isgmt = 0;  fclose (f);  /* First "register" all timezone names.  */  for (i = 0; i < num_types; ++i)    (void) __tzstring (&zone_names[types[i].idx]);  /* Find the standard and daylight time offsets used by the rule file.     We choose the offsets in the types of each flavor that are     transitioned to earliest in time.  */  __tzname[0] = NULL;  __tzname[1] = NULL;  for (i = num_transitions; i > 0; )    {      int type = type_idxs[--i];      int dst = types[type].isdst;      int idx = types[type].idx;      if (__tzname[dst] == NULL)	{	  __tzname[dst] = __tzstring (&zone_names[idx]);	  if (__tzname[1 - dst] != NULL)	    break;	}    }  if (__tzname[0] == NULL)    {      /* This should only happen if there are no transition rules.	 In this case there should be only one single type.  */      assert (num_types == 1);      __tzname[0] = __tzstring (zone_names);    }  if (__tzname[1] == NULL)    __tzname[1] = __tzname[0];  compute_tzname_max (chars);  if (num_transitions == 0)    /* Use the first rule (which should also be the only one.  */    rule_stdoff = rule_dstoff = types[0].offset;  else    {      rule_stdoff = rule_dstoff = 0;      for (i = 0; i < num_transitions; ++i)	{	  if (!rule_stdoff && !types[type_idxs[i]].isdst)	    rule_stdoff = types[type_idxs[i]].offset;	  if (!rule_dstoff && types[type_idxs[i]].isdst)	    rule_dstoff = types[type_idxs[i]].offset;	  if (rule_stdoff && rule_dstoff)	    break;	}    }  __daylight = rule_stdoff != rule_dstoff;  __timezone = -rule_stdoff;  __use_tzfile = 1;  return; lose:  fclose (f);}