From: andersb Date: Sun, 24 Sep 2006 17:59:00 +0000 (+0000) Subject: Fixed: Compiles correctly, but has a 128 char long maximum for Remote Username. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=432ad1a2825612ca3db7d4e329d51a384cfa9824;p=varnish Fixed: Compiles correctly, but has a 128 char long maximum for Remote Username. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1124 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishncsa/varnishncsa.c b/varnish-cache/bin/varnishncsa/varnishncsa.c index 37b2be93..c57b38ed 100644 --- a/varnish-cache/bin/varnishncsa/varnishncsa.c +++ b/varnish-cache/bin/varnishncsa/varnishncsa.c @@ -91,6 +91,7 @@ extended_log_format(void *priv, unsigned tag, unsigned fd, unsigned len, unsigne unsigned lu; struct tm tm; char tbuf[40]; + char rubuf[128]; struct logline *lp; if (!(spec &VSL_S_CLIENT)) @@ -177,11 +178,13 @@ extended_log_format(void *priv, unsigned tag, unsigned fd, unsigned len, unsigne if (lp->df_RU != NULL){ base64_init(); - lu = sizeof lp->df_RU; - base64_decode(lp->df_RU, &lu, lp->df_RU); - q = strchr(lp->df_RU, ':'); - *q = '\0'; - fprintf(fo, " %s", lp->df_RU); + lu = sizeof rubuf; + base64_decode(rubuf, lu, lp->df_RU); + q = strchr(rubuf, ':'); + if (q != NULL){ + *q = '\0'; + } + fprintf(fo, " %s", rubuf); free(lp->df_RU); lp->df_RU = NULL; }