fix ecpg core dump when there's a very long struct variable name in .pgc file

From: Chen Huajun <chenhj(at)cn(dot)fujitsu(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: fix ecpg core dump when there's a very long struct variable name in .pgc file
Date: 2012-11-22 10:09:20
Message-ID: 50ADF9D0.6020405@cn.fujitsu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

hi

I found a small bug in ecpg command and try to fix it.
Please check if it is correct.

When use a struct variable whose name length is very very long such as 12KB in .pgc source,
ecpg will core dump because of buffer overflow if precompile the .pgc file.

$ ecpg testLongStructName.pgc
Segmentation fault (core dumped)

Normally no body will write a variable with so long name,
but whether it's better to fix it.

Best Regards,
Chen Huajun

Attachment Content-Type Size
ecpg_LongStrucNameDump_fix.diff text/plain 778 bytes
testLongStructName12K.zip application/x-zip-compressed 825 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sebastien FLAESCH 2012-11-22 10:26:51 Re: Database object names and libpq in UTF-8 locale on Windows
Previous Message Boszormenyi Zoltan 2012-11-22 10:06:52 Re: [PATCH] Make pg_basebackup configure and start standby [Review]