mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
Fix buffer overflow on particularly named files and clarify documentation about
output file naming. Patch by Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
This commit is contained in:
parent
ea0aa9698c
commit
4032ef18d0
@ -42,11 +42,9 @@ PostgreSQL documentation
|
|||||||
<para>
|
<para>
|
||||||
<command>ecpg</command> will convert each input file given on the
|
<command>ecpg</command> will convert each input file given on the
|
||||||
command line to the corresponding C output file. Input files
|
command line to the corresponding C output file. Input files
|
||||||
preferably have the extension <filename>.pgc</filename>, in which
|
preferably have the extension <filename>.pgc</filename>.
|
||||||
case the extension will be replaced by <filename>.c</filename> to
|
The extension will be replaced by <filename>.c</filename> to
|
||||||
determine the output file name. If the extension of the input file
|
determine the output file name.
|
||||||
is not <filename>.pgc</filename>, then the output file name is
|
|
||||||
computed by appending <literal>.c</literal> to the full file name.
|
|
||||||
The output file name can also be overridden using the
|
The output file name can also be overridden using the
|
||||||
<option>-o</option> option.
|
<option>-o</option> option.
|
||||||
</para>
|
</para>
|
||||||
|
@ -313,7 +313,8 @@ main(int argc, char *const argv[])
|
|||||||
base_yyout = stdout;
|
base_yyout = stdout;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
output_filename = mm_strdup(input_filename);
|
output_filename = mm_alloc(strlen(input_filename) + 3);
|
||||||
|
strcpy(output_filename, input_filename);
|
||||||
|
|
||||||
ptr2ext = strrchr(output_filename, '.');
|
ptr2ext = strrchr(output_filename, '.');
|
||||||
/* make extension = .c resp. .h */
|
/* make extension = .c resp. .h */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user