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:21 +0200 |
commit | 12c42a543ac80f44e02173c2d6d51ffe18de2703 (patch) | |
tree | 3b4127b006338448ed20e98d063824bf9287b20d /src | |
parent | f4daf89582196596b947b9be96394a1f63a986dc (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 c388cb66ed5..9ac68edbb8e 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -1376,7 +1376,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; |