diff options
| author | Michael Meskes | 2016-12-22 07:28:13 +0000 |
|---|---|---|
| committer | Michael Meskes | 2016-12-22 07:30:06 +0000 |
| commit | 3af172f7b68763fbbf720d11be88784f21c4c1d1 (patch) | |
| tree | 29873a039bdf2a879b8400cfa7ea0d2a35979017 /src/interfaces | |
| parent | 0f5b1867c2e6b752336f0b32d05f94c424664f79 (diff) | |
Fix buffer overflow on particularly named files and clarify documentation about
output file naming.
Patch by Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.c b/src/interfaces/ecpg/preproc/ecpg.c index 224731b3b4e..96a502a6447 100644 --- a/src/interfaces/ecpg/preproc/ecpg.c +++ b/src/interfaces/ecpg/preproc/ecpg.c @@ -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 */ |
