Re: pg_dumpall segfault

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nick Eskelinen <nickesk(at)bu(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_dumpall segfault
Date: 2003-03-14 23:15:07
Message-ID: 24640.1047683707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Nick Eskelinen <nickesk(at)bu(dot)edu> writes:
> Ahh... as a matter of fact I do. Adding someone to this empty group
> corrects the problem.

Thought so. I've committed a fix if you need it:

*** src/bin/pg_dump/pg_dumpall.c.orig Thu Mar 6 16:45:52 2003
--- src/bin/pg_dump/pg_dumpall.c Fri Mar 14 17:41:56 2003
***************
*** 327,333 ****

val = strdup(PQgetvalue(res, i, 2));
tok = strtok(val, ",{}");
! do
{
PGresult *res2;
PQExpBuffer buf2 = createPQExpBuffer();
--- 327,333 ----

val = strdup(PQgetvalue(res, i, 2));
tok = strtok(val, ",{}");
! while (tok)
{
PGresult *res2;
PQExpBuffer buf2 = createPQExpBuffer();
***************
*** 347,353 ****

tok = strtok(NULL, "{},");
}
! while (tok);

printf("%s", buf->data);
destroyPQExpBuffer(buf);
--- 347,353 ----

tok = strtok(NULL, "{},");
}
! free(val);

printf("%s", buf->data);
destroyPQExpBuffer(buf);

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Laurent FAILLIE 2003-03-14 23:54:09 Re: Bug #899: pg_dumpall produce erroneous files if the databbase
Previous Message Nick Eskelinen 2003-03-14 23:12:04 Re: pg_dumpall segfault