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

Re: BUG #1270: stack overflow in thread in fe_getauthname

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Davie <Peter(dot)Davie(at)relevance(dot)com(dot)au>,pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname
Date: 2004-09-27 23:55:55
Message-ID: 8336.1096329355@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Oops.  Yep, that is sloppy programming on our part, perhaps my part if I
> added those.  Anyway, patch attached and applied. I used the proper
> struct sizes instead of BUFSIZ.

You just broke it.

Those buffers are not used to hold struct passwd's, but to hold
multiple character strings to which the struct passwd will point;
any one of which could be long, but particularly the home directory
path.

My man page for getpwuid_r says that the minimum recommended buffer size
is 1024.

> This will be in 8.0.

I think we should revert it entirely.  A small buffer size risks
breaking things unnecessarily, and as I replied earlier, the request
to make libpq run in a less-than-8K stack is not reasonable anyway.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2004-09-27 23:56:27
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname
Previous:From: Tom LaneDate: 2004-09-27 23:45:54
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname

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