trivial patch for pg_dump blob problem

From: Oleg Drokin <green(at)linuxhacker(dot)ru>
To: pgsql-patches(at)postgresql(dot)org
Subject: trivial patch for pg_dump blob problem
Date: 2003-02-08 17:32:17
Message-ID: 20030208173217.GA2413@linuxhacker.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Hello!

In case when there some error have occured getting blob data,
instead of failing gracefully failing, it will probably segfault
or loop forever.
All of this will happen only on platforms where size_t is unsigned
(e.g. on Linux systems modulo Linux/sparc32).
Simple non-intrusive patch is below ;)

Bye,
Oleg

--- postgresql-7.3.2/src/bin/pg_dump/pg_dump.c.orig Sat Feb 8 20:23:54 2003
+++ postgresql-7.3.2/src/bin/pg_dump/pg_dump.c Sat Feb 8 20:25:13 2003
@@ -1355,7 +1355,7 @@
do
{
cnt = lo_read(g_conn, loFd, buf, loBufSize);
- if (cnt < 0)
+ if ((int)cnt < 0)
{
write_msg(NULL, "dumpBlobs(): error reading large object: %s",
PQerrorMessage(g_conn));

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message greg 2003-02-10 15:12:36 FAQ addition: deleteing all but one unique row
Previous Message Tom Lane 2003-02-06 15:19:12 Re: lock.h and proc.h