Unix Technical Forum

pgsql: Tweak libpq to avoid crashing due to incorrect buffer size

This is a discussion on pgsql: Tweak libpq to avoid crashing due to incorrect buffer size within the pgsql Committers forums, part of the PostgreSQL category; --> Log Message: ----------- Tweak libpq to avoid crashing due to incorrect buffer size calculation when we are on a ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Committers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-02-2008, 12:35 PM
Tom Lane
 
Posts: n/a
Default pgsql: Tweak libpq to avoid crashing due to incorrect buffer size

Log Message:
-----------
Tweak libpq to avoid crashing due to incorrect buffer size calculation when
we are on a 64-bit machine (ie, size_t is wider than int) and someone passes
in a query string that approaches or exceeds INT_MAX bytes. Also, just for
paranoia's sake, guard against similar overflows in sizing the input buffer.

The backend will not in the foreseeable future be prepared to send or receive
strings exceeding 1GB, so I didn't take the more invasive step of switching
all the buffer index variables from int to size_t; though someday we might
want to do that.

I have a suspicion that this is not the only such bug in libpq, but this
fix is enough to take care of the crash reported by Francisco Reyes.

Modified Files:
--------------
pgsql/src/interfaces/libpq:
fe-connect.c (r1.358 -> r1.359)
(http://anoncvs.postgresql.org/cvsweb...1.358&r2=1.359)
fe-exec.c (r1.194 -> r1.195)
(http://anoncvs.postgresql.org/cvsweb...1.194&r2=1.195)
fe-misc.c (r1.133 -> r1.134)
(http://anoncvs.postgresql.org/cvsweb...1.133&r2=1.134)
fe-protocol3.c (r1.34 -> r1.35)
(http://anoncvs.postgresql.org/cvsweb...1=1.34&r2=1.35)
libpq-int.h (r1.130 -> r1.131)
(http://anoncvs.postgresql.org/cvsweb...1.130&r2=1.131)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:02 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com