Commit 957b90ed authored by Tom Lane's avatar Tom Lane

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.
parent c826991d
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * 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) ...@@ -144,14 +144,14 @@ next_token(FILE *fp, char *buf, int bufsz)
if (buf >= end_buf) if (buf >= end_buf)
{ {
*buf = '\0';
ereport(LOG, ereport(LOG,
(errcode(ERRCODE_CONFIG_FILE_ERROR), (errcode(ERRCODE_CONFIG_FILE_ERROR),
errmsg("authentication file token too long, skipping: \"%s\"", errmsg("authentication file token too long, skipping: \"%s\"",
buf))); start_buf)));
/* Discard remainder of line */ /* Discard remainder of line */
while ((c = getc(fp)) != EOF && c != '\n') while ((c = getc(fp)) != EOF && c != '\n')
; ;
buf[0] = '\0';
break; break;
} }
......
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