diff --git a/src/conf.c b/src/conf.c index bac80fd..e5feac7 100644 --- a/src/conf.c +++ b/src/conf.c @@ -105,6 +105,10 @@ unsigned char * dologname (unsigned char *buf, unsigned char *name, const unsign struct tm *ts; ts = localtime(&t); + if(strlen((char *)name) >= 4096){ + *buf = 0; + return buf; + } if(strchr((char *)name, '%')){ struct clientparam fakecli; @@ -1682,7 +1686,7 @@ int parsestr (unsigned char *str, unsigned char **argm, int nitems, unsigned cha } switch(*str){ case '\0': - if(comment) return -1; + if(comment || incbegin) return -1; argm[argc] = 0; return argc; case '$': @@ -1709,14 +1713,14 @@ int parsestr (unsigned char *str, unsigned char **argm, int nitems, unsigned cha argc--; if((fd = open((char *)incbegin+1, O_RDONLY)) <= 0){ fprintf(stderr, "Failed to open %s\n", incbegin+1); - break; + return -1; } if((*bufsize - *inbuf)