mirror of
https://github.com/postgres/postgres.git
synced 2025-05-08 07:21:33 +03:00
Fix potential memory access violation in ecpg if filename of include file is
shorter than 2 characters. Patch by: "Wu, Fei" <wufei.fnst@cn.fujitsu.com>
This commit is contained in:
parent
b16f8a2905
commit
e7adda86ba
@ -1396,7 +1396,7 @@ parse_include(void)
|
|||||||
yyin = fopen(inc_file, "r");
|
yyin = fopen(inc_file, "r");
|
||||||
if (!yyin)
|
if (!yyin)
|
||||||
{
|
{
|
||||||
if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
|
if (strlen(inc_file) <= 2 || strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
|
||||||
{
|
{
|
||||||
strcat(inc_file, ".h");
|
strcat(inc_file, ".h");
|
||||||
yyin = fopen(inc_file, "r");
|
yyin = fopen(inc_file, "r");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user