Skip to content

Commit 12c42a5

Browse files
author
Michael Meskes
committed
Fix off-by-one check that can lead to a memory overflow in ecpg.
Patch by Liu Huailing <liuhuailing@cn.fujitsu.com>
1 parent f4daf89 commit 12c42a5

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
@@ -1376,7 +1376,7 @@ parse_include(void)
13761376

13771377
for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next)
13781378
{
1379-
if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH)
1379+
if (strlen(ip->path) + strlen(yytext) + 4 > MAXPGPATH)
13801380
{
13811381
fprintf(stderr, _("Error: include path \"%s/%s\" is too long on line %d, skipping\n"), ip->path, yytext, yylineno);
13821382
continue;

0 commit comments

Comments
 (0)