From: Tom Lane Date: Tue, 25 May 2004 19:11:26 +0000 (+0000) Subject: Fix erroneous error message printout when a configuration file contains X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=9544d69131ee5f3c2d17652dd965c064c4749f80;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index d77ae5b830..0f508e9102 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -124,14 +124,14 @@ next_token(FILE *fp, char *buf, const 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; }