mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-16 11:26:59 +08:00
Fix off-by-one check that can lead to a memory overflow in ecpg.
Patch by Liu Huailing <liuhuailing@cn.fujitsu.com>
This commit is contained in:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user