Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e7adda8

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 b16f8a2 commit e7adda8

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
@@ -1396,7 +1396,7 @@ parse_include(void)
13961396
yyin = fopen(inc_file, "r");
13971397
if (!yyin)
13981398
{
1399-
if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
1399+
if (strlen(inc_file) <= 2 || strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
14001400
{
14011401
strcat(inc_file, ".h");
14021402
yyin = fopen(inc_file, "r");

0 commit comments

Comments
 (0)