Re: oid2name core dump - Mailing list pgsql-bugs

From Michael Fuhr
Subject Re: oid2name core dump
Date
Msg-id 20041202045513.GA60677@winnie.fuhr.org
Whole thread Raw
In response to oid2name core dump  (Michael Fuhr <mike@fuhr.org>)
List pgsql-bugs
On Wed, Dec 01, 2004 at 09:41:49PM -0700, Michael Fuhr wrote:

> The warnings are coming from these two lines (around lines 448 and 449):
>
>     free(comma_oids);
>     free(comma_tables);
>
> Apparently the values of comma_oids and comma_tables are bogus.
> I haven't looked more closely yet to see why.

main() initializes my_opts->oids->num and my_opts->tables->num to 0.
sql_exec_searchtables() later sets comma_oids and comma_tables with
the following code:

    comma_oids = get_comma_elts(opts->oids);
    comma_tables = get_comma_elts(opts->tables);

get_comma_elts() starts with the following:

    if (eary->num == 0)
        return "";

sql_exec_searchtables() later tries to free the pointers to "".
Program fall down go boom.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: oid2name core dump
Next
From: "Dave Page"
Date:
Subject: Re: BUG #1319: Windows LIB file libecpg.lib not in build or package