mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +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
98bdaab0d9
commit
08cecfaf60
@ -1538,7 +1538,7 @@ parse_include(void)
|
||||
yyin = fopen(inc_file, "r");
|
||||
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");
|
||||
yyin = fopen(inc_file, "r");
|
||||
|
Loading…
x
Reference in New Issue
Block a user