aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2019-04-11 20:56:17 +0200
committerMichael Meskes <meskes@postgresql.org>2019-04-11 20:56:17 +0200
commited16ba3248d486ec8b2fdfc75e442620d675b617 (patch)
treece9dad5133a7c52ce06da7df42f65298a3364367 /src
parent4aaa3b5cf1c33d713b8eefa3612a9112cbcf1074 (diff)
downloadpostgresql-ed16ba3248d486ec8b2fdfc75e442620d675b617.tar.gz
postgresql-ed16ba3248d486ec8b2fdfc75e442620d675b617.zip
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 60474b0b4a6..3dc2453a2fc 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -1556,7 +1556,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;