Skip to content

Commit e7e78f1

Browse files
author
Michael Meskes
committed
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>
1 parent e04bb26 commit e7e78f1

File tree

1 file changed

+1
-1
lines changed
  • src/interfaces/ecpg/preproc

1 file changed

+1
-1
lines changed

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ parse_include(void)
13581358
yyin = fopen(inc_file, "r");
13591359
if (!yyin)
13601360
{
1361-
if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
1361+
if (strlen(inc_file) <= 2 || strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
13621362
{
13631363
strcat(inc_file, ".h");
13641364
yyin = fopen(inc_file, "r");

0 commit comments

Comments
 (0)