aboutsummaryrefslogtreecommitdiff
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 21:06:10 +0200
commit67f6e645e7acf356abb1b914a1d8536708ec0f67 (patch)
tree54caf321363a5e50a997e4175c122fa9a499757e
parentd3cf886e314aa6f64a336dc447c68be33d63df34 (diff)
downloadpostgresql-67f6e645e7acf356abb1b914a1d8536708ec0f67.tar.gz
postgresql-67f6e645e7acf356abb1b914a1d8536708ec0f67.zip
Fix off-by-one check that can lead to a memory overflow in ecpg.
Patch by Liu Huailing <liuhuailing@cn.fujitsu.com>
-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 b139e1331cb..490b22c6daf 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;