From: Frédéric Marchal Date: Wed, 9 Sep 2009 05:26:32 +0000 (+0000) Subject: Stop if the output file name is more than 255 characters instead of truncating the... X-Git-Tag: v2_2_6~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24977ddbd34dacbb6570e00d7982087ae4f9e988;p=thirdparty%2Fsarg.git Stop if the output file name is more than 255 characters instead of truncating the file name and using an invalid name. --- diff --git a/report.c b/report.c index 1d0bf8e..b0696e2 100644 --- a/report.c +++ b/report.c @@ -220,9 +220,8 @@ void gerarel(void) my_mkdir(arqtt); sprintf(arqtt,"%s/%s/tt%s-%s.html",dirname,accuser,accuser,siteind); if(strlen(arqtt) > 255) { - strncpy(val7,arqtt,255); - bzero(arqtt,MAXLEN); - strcpy(arqtt,val7); + fprintf(stderr, "SARG: (report) output file name too long: %s\n",arqtt); + exit(1); } if ((fp_tt = fopen(arqtt, "w")) == 0) { fprintf(stderr, "SARG: (report) %s: %s\n",text[45],arqtt); @@ -230,11 +229,13 @@ void gerarel(void) } ttopen=1; + /* if(strcmp(Privacy,"yes") == 0) sprintf(httplink,"%s", \ FontSize,PrivacyStringColor,PrivacyString,PrivacyString); else sprintf(httplink,"%s",FontSize,accurl,accurl); + */ sprintf(ltext110,"%s",text[110]); for(s=ltext110; *s; ++s)