Re: BUG #15104: Double free in the main function in ecpg.c - Mailing list pgsql-bugs

From Michael Meskes
Subject Re: BUG #15104: Double free in the main function in ecpg.c
Date
Msg-id 1520613211.2488.140.camel@postgresql.org
Whole thread Raw
In response to BUG #15104: Double free in the main function in ecpg.c  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #15104: Double free in the main function in ecpg.c  (Patrick Krecker <pkrecker@gmail.com>)
List pgsql-bugs
> Details: In function main(), the memory hold by variable
> output_filename is
> freed at line 329. It then tries to parse the next command option.
> The freed
> memory will be freed again at line 478 if a crafted option bypass the
> memory
> allocation at line 316. I think set output_filename to NULL after the
> free
> operation at line 329 will fix the issue.
> ...

I haven't had time yet to look into this, but to speed things up, would
you have an example where the double free actually happens?

Thanks.

Michael
--
Michael Meskes
Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Net|Org)
Meskes at (Debian|Postgresql) dot Org
Jabber: michael at xmpp dot meskes dot org
VfL Borussia! Força Barça! SF 49ers! Use Debian GNU/Linux, PostgreSQL


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #15105: OpenTransientFile() should be paired with CloseTransientFile() rather than close()
Next
From: Kouber Saparev
Date:
Subject: Unrecognized exception condition "deprecated_feature"