mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-02 06:03:50 +00:00
f51825299d
- fixes buffer-overflow repoted on BUGTRAQ - part of patch is now in the distribution
72 lines
2.8 KiB
Plaintext
72 lines
2.8 KiB
Plaintext
--- webalizer.c.orig Wed Oct 24 10:24:51 2001
|
|
+++ webalizer.c Tue Feb 12 05:29:59 2002
|
|
@@ -231,7 +231,7 @@
|
|
int main(int argc, char *argv[])
|
|
{
|
|
int i; /* generic counter */
|
|
- char *cp1, *cp2, *cp3, *str; /* generic char pointers */
|
|
+ unsigned char *cp1, *cp2, *cp3, *str; /* generic char pointers */
|
|
NLISTPTR lptr; /* generic list pointer */
|
|
|
|
extern char *optarg; /* used for command line */
|
|
@@ -569,7 +569,7 @@
|
|
|
|
/* convert month name to lowercase */
|
|
for (i=4;i<7;i++)
|
|
- log_rec.datetime[i]=tolower(log_rec.datetime[i]);
|
|
+ log_rec.datetime[i]=tolower((unsigned char)log_rec.datetime[i]);
|
|
|
|
/* get year/month/day/hour/min/sec values */
|
|
for (i=0;i<12;i++)
|
|
@@ -713,7 +713,7 @@
|
|
{
|
|
if ((cp1=strstr(log_rec.url,lptr->string))!=NULL)
|
|
{
|
|
- if ((cp1==log_rec.url)||(*(cp1-1)=='/'))
|
|
+ if ((cp1==(unsigned char *)log_rec.url)||(*(cp1-1)=='/'))
|
|
{
|
|
*cp1='\0';
|
|
if (log_rec.url[0]=='\0')
|
|
@@ -1466,19 +1466,19 @@
|
|
while ( (fgets(buffer,BUFSIZE,fp)) != NULL)
|
|
{
|
|
/* skip comments and blank lines */
|
|
- if ( (buffer[0]=='#') || isspace((int)buffer[0]) ) continue;
|
|
+ if ( (buffer[0]=='#') || isspace((unsigned char)buffer[0]) ) continue;
|
|
|
|
/* Get keyword */
|
|
cp1=buffer;cp2=keyword;
|
|
- while ( isalnum((int)*cp1) ) *cp2++ = *cp1++;
|
|
+ while ( isalnum((unsigned char)*cp1) ) *cp2++ = *cp1++;
|
|
*cp2='\0';
|
|
|
|
/* Get value */
|
|
cp2=value;
|
|
- while ( (*cp1!='\n')&&(*cp1!='\0')&&(isspace((int)*cp1)) ) cp1++;
|
|
+ while ( (*cp1!='\n')&&(*cp1!='\0')&&(isspace((unsigned char)*cp1)) ) cp1++;
|
|
while ( (*cp1!='\n')&&(*cp1!='\0') ) *cp2++ = *cp1++;
|
|
*cp2--='\0';
|
|
- while ( (isspace((int)*cp2)) && (cp2 != value) ) *cp2--='\0';
|
|
+ while ( (isspace((unsigned char)*cp2)) && (cp2 != value) ) *cp2--='\0';
|
|
|
|
/* check if blank keyword/value */
|
|
if ( (keyword[0]=='\0') || (value[0]=='\0') ) continue;
|
|
@@ -1820,7 +1820,7 @@
|
|
if (*cp1=='+') *cp1=' '; /* change + to space */
|
|
if (sp_flg && *cp1==' ') { cp1++; continue; } /* compress spaces */
|
|
if (*cp1==' ') sp_flg=1; else sp_flg=0; /* (flag spaces here) */
|
|
- *cp2++=tolower(*cp1); /* normal character */
|
|
+ *cp2++= *cp1; /* normal character */
|
|
cp1++;
|
|
}
|
|
}
|
|
@@ -1855,7 +1855,7 @@
|
|
int i=group_domains+1;
|
|
|
|
cp = str+strlen(str)-1;
|
|
- if (isdigit((int)*cp)) return NULL; /* ignore IP addresses */
|
|
+ if (isdigit((unsigned char)*cp)) return NULL; /* ignore IP addresses */
|
|
|
|
while (cp!=str)
|
|
{
|