Commit 41039944 authored by Geoff Simmons's avatar Geoff Simmons

formatter for %u does not modify the payload

parent 948562e3
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "vas.h" #include "vas.h"
#include "miniobj.h" #include "miniobj.h"
#include "base64.h" #include "base64.h"
#include "vre.h"
#include "varnishevent.h" #include "varnishevent.h"
#include "format.h" #include "format.h"
...@@ -445,7 +444,8 @@ static inline void ...@@ -445,7 +444,8 @@ static inline void
format_tim(const tx_t *tx, const char *fmt, char **s, size_t *len) format_tim(const tx_t *tx, const char *fmt, char **s, size_t *len)
{ {
unsigned secs, usecs; unsigned secs, usecs;
char *data, *ts; char *data;
const char *ts;
time_t t; time_t t;
struct tm tm; struct tm tm;
...@@ -526,14 +526,15 @@ format_u(const tx_t *tx, enum VSL_tag_e tag, char **s, size_t *len) ...@@ -526,14 +526,15 @@ format_u(const tx_t *tx, enum VSL_tag_e tag, char **s, size_t *len)
if ((hdr = get_hdr(tx, tag, "Authorization")) != NULL if ((hdr = get_hdr(tx, tag, "Authorization")) != NULL
&& strncasecmp(get_fld(hdr, 0, len), "Basic", 5) == 0) { && strncasecmp(get_fld(hdr, 0, len), "Basic", 5) == 0) {
char *c, *auth = get_fld(hdr, 1, len); const char *c, *auth = get_fld(hdr, 1, len);
VB64_init(); VB64_init();
VB64_decode(scratch, config.max_reclen, auth, auth + *len); VB64_decode(scratch, config.max_reclen, auth, auth + *len);
c = strchr(scratch, ':'); c = strchr(scratch, ':');
if (c != NULL)
*c = '\0';
*s = scratch; *s = scratch;
*len = strlen(scratch); if (c != NULL)
*len = c - scratch;
else
*len = strlen(scratch);
} }
else { else {
*s = dash; *s = dash;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment