diff options
author | Michael Meskes <meskes@postgresql.org> | 2019-04-11 20:56:17 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2019-04-11 21:06:10 +0200 |
commit | 67f6e645e7acf356abb1b914a1d8536708ec0f67 (patch) | |
tree | 54caf321363a5e50a997e4175c122fa9a499757e | |
parent | d3cf886e314aa6f64a336dc447c68be33d63df34 (diff) | |
download | postgresql-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.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 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; |