trivial patch for pg_dump blob problem - Mailing list pgsql-patches

From Oleg Drokin
Subject trivial patch for pg_dump blob problem
Date
Msg-id 20030208173217.GA2413@linuxhacker.ru
Whole thread Raw
Responses Re: trivial patch for pg_dump blob problem
List 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));

pgsql-patches by date:

Previous
From: "Zhenbang Wei"
Date:
Subject: [PATCH]errors_zh_TW.properties for JDBC driver
Next
From: Tom Lane
Date:
Subject: Re: plpython: fix for improperly handled NULL arguments in prepared plans