diff options
| author | Michael Meskes | 2019-04-11 18:56:17 +0000 |
|---|---|---|
| committer | Michael Meskes | 2019-04-11 19:05:59 +0000 |
| commit | 77300684867f93aebd29de106f8adcf0797bcb21 (patch) | |
| tree | 7eb09e341d4164682976a722186157d5d8630a5e /src | |
| parent | c4dfe5718f661b18c68485e1faecf1b0b10dbaca (diff) | |
Fix off-by-one check that can lead to a memory overflow in ecpg.
Patch by Liu Huailing <liuhuailing@cn.fujitsu.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index cc1f0709b3f..c2b8bf01b5e 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -1412,7 +1412,7 @@ parse_include(void) for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next) { - if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH) + if (strlen(ip->path) + strlen(yytext) + 4 > MAXPGPATH) { fprintf(stderr, _("Error: include path \"%s/%s\" is too long on line %d, skipping\n"), ip->path, yytext, yylineno); continue; |
