1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-22 02:52:08 +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:
Michael Meskes
2016-12-22 08:28:13 +01:00
parent ea0aa9698c
commit 4032ef18d0
2 changed files with 5 additions and 6 deletions

View File

@ -313,7 +313,8 @@ main(int argc, char *const argv[])
base_yyout = stdout;
else
{
output_filename = mm_strdup(input_filename);
output_filename = mm_alloc(strlen(input_filename) + 3);
strcpy(output_filename, input_filename);
ptr2ext = strrchr(output_filename, '.');
/* make extension = .c resp. .h */