Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1df8b3f

Browse files
author
Michael Meskes
committed
Fix buffer overflow on particularly named files and clarify documentation about
output file naming.Patch by Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
1 parent3272be3 commit1df8b3f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

‎doc/src/sgml/ref/ecpg-ref.sgml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ PostgreSQL documentation
4242
<para>
4343
<command>ecpg</command> will convert each input file given on the
4444
command line to the corresponding C output file. Input files
45-
preferably have the extension <filename>.pgc</filename>, in which
46-
case the extension will be replaced by <filename>.c</filename> to
47-
determine the output file name. If the extension of the input file
48-
is not <filename>.pgc</filename>, then the output file name is
49-
computed by appending <literal>.c</literal> to the full file name.
45+
preferably have the extension <filename>.pgc</filename>.
46+
The extension will be replaced by <filename>.c</filename> to
47+
determine the output file name.
5048
The output file name can also be overridden using the
5149
<option>-o</option> option.
5250
</para>

‎src/interfaces/ecpg/preproc/ecpg.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ main(int argc, char *const argv[])
309309
base_yyout=stdout;
310310
else
311311
{
312-
output_filename=strdup(input_filename);
312+
output_filename=mm_alloc(strlen(input_filename)+3);
313+
strcpy(output_filename,input_filename);
313314

314315
ptr2ext=strrchr(output_filename,'.');
315316
/* make extension = .c resp. .h */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp