Skip site navigation (1) Skip section navigation (2)

Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martin Pitt <martin(at)piware(dot)de>
Cc: PostgreSQL Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Date: 2004-05-25 14:38:53
Message-ID: 22923.1085495933@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Martin Pitt <martin(at)piware(dot)de> writes:
> 2004-05-14 14:50:14 [8725] LOG:  authentication file token too long, skippi=
> ng: "=98.=ED=F1
> Segmentation fault

Looking at the only place this message is produced, in
src/backend/libpq/hba.c, it appears that we are printing a string buffer
that is not guaranteed null-terminated.  The segfault might be due to
that.  I would suggest adding more paranoia along these lines:

        if (buf >= end_buf)
        {
+           *buf = '\0';
            ereport(LOG,
                    (errcode(ERRCODE_CONFIG_FILE_ERROR),
                     errmsg("authentication file token too long, skipping: \"%s\"",
                            buf)));
            /* Discard remainder of line */
            while ((c = getc(fp)) != EOF && c != '\n')
                ;
-           buf[0] = '\0';
            break;
        }

This won't fix the underlying problem (where is the junk data coming
from?) but it might at least let you get further in your investigation.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-05-25 19:13:38
Subject: Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins in nsswitch.conf
Previous:From: Richard HuxtonDate: 2004-05-25 13:56:45
Subject: Re: Fwd: Bug#249083: postgresql: Postgres SIGSEGV if wins

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group