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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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