summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes2019-04-11 18:56:17 +0000
committerMichael Meskes2019-04-11 19:05:59 +0000
commit77300684867f93aebd29de106f8adcf0797bcb21 (patch)
tree7eb09e341d4164682976a722186157d5d8630a5e /src
parentc4dfe5718f661b18c68485e1faecf1b0b10dbaca (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.l2
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;