From: Peter Eisentraut Date: Thu, 24 Aug 2017 17:11:03 +0000 (-0400) Subject: Fix crash from memory overrun X-Git-Tag: pgbouncer_1_8~14^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d8d5148ffb46a8702bf7ad818ac635a6147856e2;p=pgbouncer Fix crash from memory overrun Fixes: #228 --- diff --git a/src/hba.c b/src/hba.c index afa726f..8d68bde 100644 --- a/src/hba.c +++ b/src/hba.c @@ -250,7 +250,7 @@ static enum TokType next_token(struct TokParser *p) if (isspace((unsigned char)*s)) break; } - if (!tok_buf_check(p, s - p->pos)) + if (!tok_buf_check(p, s - p->pos + 1)) return TOK_FAIL; memcpy(p->buf, p->pos, s - p->pos); p->buf[s - p->pos] = 0;