[bug fix] Trivial ecpg bug which can cause memory overrun

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: [bug fix] Trivial ecpg bug which can cause memory overrun
Date: 2016-12-22 06:12:58
Message-ID: 0A3221C70F24FB45833433255569204D1F66B412@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

While investigating some other issue, we found a trivial bug of ecpg. The attached is a fix for that.

If you specify an input file which ends with "." (e.g. run "ecpg file."), ecpg writes one byte past the end of the allocated memory.

In addition, the following statement is misleading. Some people may think that file.ec.c will be converted to a.ec.c. But the actual behavior is that it is converted to file.c. So I clarified the paragraph a bit.

"If the extension of the input file is not .pgc, then the output file name is computed by appending .c to the full file name."

Regards
Takayuki Tsunakawa

Attachment Content-Type Size
ecpg_outfile.patch application/octet-stream 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2016-12-22 06:14:45 Re: WAL consistency check facility
Previous Message Joe Conway 2016-12-22 06:04:51 Re: Getting rid of "unknown error" in dblink and postgres_fdw