Skip to content

Commit

Permalink
varnishncsa: Reduce CTX.gen overflow likelihood
Browse files Browse the repository at this point in the history
If a format never matches anything, the 4294967296th transaction
proccessed by varnishncsa will wrap its generation around to zero,
be considered a match, and let vsb_fcat() pass a null string to
VSB_quote().
  • Loading branch information
walid-git authored and Dridi committed Mar 20, 2024
1 parent 23229eb commit 13fe897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/varnishncsa/varnishncsa.c
Expand Up @@ -93,7 +93,7 @@ enum e_frag {
};

struct fragment {
unsigned gen;
uint64_t gen;
const char *b, *e;
};

Expand Down Expand Up @@ -144,7 +144,7 @@ static struct ctx {

FILE *fo;
struct vsb *vsb;
unsigned gen;
uint64_t gen;
VTAILQ_HEAD(,format) format;
int quote_how;
char *missing_string;
Expand Down

0 comments on commit 13fe897

Please sign in to comment.