diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-25 19:11:14 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-25 19:11:14 +0000 |
commit | 957b90ed6aaa6fb05ecfe90776a0d7d34d344536 (patch) | |
tree | 6eb19cce0704277be6860485d090ca203ab2c0b6 /src | |
parent | c826991dd7c17bca8fd4e679db96283a32708bdb (diff) | |
download | postgresql-957b90ed6aaa6fb05ecfe90776a0d7d34d344536.tar.gz postgresql-957b90ed6aaa6fb05ecfe90776a0d7d34d344536.zip |
Fix erroneous error message printout when a configuration file contains
an overlength token. Printout was always garbage and could dump core
entirely :-(. Per report from Martin Pitt.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 00acbcf5617..d4204acfd57 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.121 2004/05/19 22:06:16 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.122 2004/05/25 19:11:14 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -144,14 +144,14 @@ next_token(FILE *fp, char *buf, int bufsz) if (buf >= end_buf) { + *buf = '\0'; ereport(LOG, (errcode(ERRCODE_CONFIG_FILE_ERROR), errmsg("authentication file token too long, skipping: \"%s\"", - buf))); + start_buf))); /* Discard remainder of line */ while ((c = getc(fp)) != EOF && c != '\n') ; - buf[0] = '\0'; break; } |