Possible bug in plpgsql/src/gram.y

From: Ian Lance Taylor <ian(at)airs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Possible bug in plpgsql/src/gram.y
Date: 2001-07-12 00:38:28
Message-ID: 20010712003828.9125.qmail@daffy.airs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In this bit of code in src/pl/plpgsql/src/gram.y in the current CVS
sources, curname_def is defined as PLpgSQL_expr * but it is is
allocated the space required for a PLpgSQL_var. This looks like a
bug.

Ian

| decl_varname K_CURSOR decl_cursor_args decl_is_from K_SELECT decl_cursor_query
{
PLpgSQL_var *new;
PLpgSQL_expr *curname_def;
char buf[1024];
char *cp1;
char *cp2;

plpgsql_ns_pop();

new = malloc(sizeof(PLpgSQL_var));
memset(new, 0, sizeof(PLpgSQL_var));

curname_def = malloc(sizeof(PLpgSQL_var));
memset(curname_def, 0, sizeof(PLpgSQL_var));

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-07-12 01:18:44 Re: Possible bug in plpgsql/src/gram.y
Previous Message Nathan Myers 2001-07-11 22:28:21 Re: Re: SOMAXCONN (was Re: Solaris source code)