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:05:39 +0200 |
commit | e7e71b9e1ecb8cb6eb490b0c82bdc5aa9604368b (patch) | |
tree | 3ceb6e5031aaf6b8e3c7887c448bf443d899b20c /src | |
parent | 2c31332267ea3d924e201054b20b080278c08305 (diff) | |
download | postgresql-e7e71b9e1ecb8cb6eb490b0c82bdc5aa9604368b.tar.gz postgresql-e7e71b9e1ecb8cb6eb490b0c82bdc5aa9604368b.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.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 deb1e554ce9..c3670b94d75 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -1411,7 +1411,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; |