Y2K-Bug in INN 1.x, 2.x

Bettina Fink laura at hydrophil.de
Sat Jan 1 04:36:08 UTC 2000


Hi,

there's a bug in INN 1.x and 2.x (tested with a heavily patched
1.5.1 and a "normal" 2.2.2):

INN is accepting and propagating articles with Date header "1900"
(e.g. "Date: 01 Jan 1900 03:00:00 GMT").

It should reject it with 'too old' or 'Can't parse "Date" header'.

Bye,
Bettina


*** lib/parsedate.y-old	Fri Dec 10 00:18:37 1999
--- lib/parsedate.y	Sat Jan  1 04:54:22 2000
***************
*** 512,521 ****
  
      if (Year < 0)
  	Year = -Year;
!     if (Year < 100)
  	Year += 1900;
!     if (Year < EPOCH)
! 	Year += 100;
      for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++)
  	if (Year == *yp) {
  	    mp = DaysLeap;
--- 512,522 ----
  
      if (Year < 0)
  	Year = -Year;
!     if (Year < 100) {
  	Year += 1900;
! 	if (Year < EPOCH)
! 	    Year += 100;
!     }
      for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++)
  	if (Year == *yp) {
  	    mp = DaysLeap;
***************
*** 570,576 ****
  
      tm = localtime(&Start);
      Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
!     Year = Month / 12;
      Month = Month % 12 + 1;
      return DSTcorrect(Start,
  	    Convert(Month, (time_t)tm->tm_mday, Year,
--- 571,577 ----
  
      tm = localtime(&Start);
      Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
!     Year = Month / 12 + 1900;
      Month = Month % 12 + 1;
      return DSTcorrect(Start,
  	    Convert(Month, (time_t)tm->tm_mday, Year,
***************
*** 751,757 ****
      }
  
      tm = localtime(&now->time);
!     yyYear = tm->tm_year;
      yyMonth = tm->tm_mon + 1;
      yyDay = tm->tm_mday;
      yyTimezone = now->tzone;
--- 752,758 ----
      }
  
      tm = localtime(&now->time);
!     yyYear = tm->tm_year + 1900;
      yyMonth = tm->tm_mon + 1;
      yyDay = tm->tm_mday;
      yyTimezone = now->tzone;

-- 
laura at hydrophil.de or           Bits/KeyID    Date
laura at rhiannon.zikzak.de        1024/A9B8829D 1996/03/07
        Key fingerprint = E5 82 7E 4C 08 1A A4 F6  DD 63 82 F8 AF D7 31 C3




More information about the inn-bugs mailing list