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

BUG #1270: stack overflow in thread in fe_getauthname

From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1270: stack overflow in thread in fe_getauthname
Date: 2004-09-27 23:09:13
Message-ID: 20040927230913.A5CB75A1039@www.postgresql.com (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1270
Logged by:          Peter Davie

Email address:      Peter(dot)Davie(at)relevance(dot)com(dot)au

PostgreSQL version: 7.4.5

Operating system:   OSF/1 4.0f

Description:        stack overflow in thread in fe_getauthname

Details: 

With the THREAD_SAFETY changes, a buffer is defined on the stack as:
char       pwdbuf[BUFSIZ];

This buffer overflows the stack when used in a thread.  As the application 
creating the thread cannot be modified to increase the stack size, it would 
probably be prudent to reduce this buffer size (I believe that BUFSIZ is 
around 8192 bytes on most modern Unix implementations). 

To rectify this issue (seg faults attempting to connect to the database), I 
replaced the above declaration with: 
char       pwdbuf[1024];
Obviously, a manifest constant would be better!


Responses

pgsql-bugs by date

Next:From: Bruce MomjianDate: 2004-09-27 23:39:14
Subject: Re: BUG #1270: stack overflow in thread in fe_getauthname
Previous:From: Hussein PatniDate: 2004-09-27 21:43:57
Subject: semicolon not required on END statement

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