From: Frédéric Marchal Date: Thu, 28 Jul 2011 15:21:20 +0000 (+0000) Subject: Correctly append a suffix to the mangled temporary file name X-Git-Tag: v2.3.2~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=815456844dc6b7c13387086cff9a443cb2cd153b;p=thirdparty%2Fsarg.git Correctly append a suffix to the mangled temporary file name When two users end up with the same mangled temporary file name, a suffix is supposed to be added at the end of the new file name to make it distinct from the previous one but the suffix was added one byte too far making it useless. The result was that the log entries of two or more users were written into the same file overwritting each other's data and corrupting the report. Thanks to Mark Dennison for reporting this bug. --- diff --git a/userinfo.c b/userinfo.c index b76ba1f..90c1433 100644 --- a/userinfo.c +++ b/userinfo.c @@ -109,7 +109,7 @@ struct userinfostruct *userinfo_create(const char *userid) } } user->filename[j]='\0'; - flen=i; + flen=i-1; count=0; for (group=first_user_group ; group ; group=group->next) {