A parsed log file name contains the date range covering the log content in
a form like sarg-15062015_0100-15062015_0101.log.gz.
The date was insufficiently validated as any date below 1900 produces
an integer overflow.
str+=2;
year0=0;
for (i=0 ; isdigit(str[i]) && i<4 ; i++) year0=year0*10+(str[i]-'0');
- if (i!=4) continue;
+ if (i!=4 || year0<1900) continue;
str+=4;
if (str[0]!='_') continue;
str++;
str+=2;
year1=0;
for (i=0 ; isdigit(str[i]) && i<4 ; i++) year1=year1*10+(str[i]-'0');
- if (i!=4) continue;
+ if (i!=4 || year1<1900) continue;
str+=4;
if (str[0]!='_') continue;