mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Some more FLEXIBLE_ARRAY_MEMBER fixes.
This commit is contained in:
@@ -97,7 +97,7 @@ plpgsql_ns_additem(int itemtype, int itemno, const char *name)
|
||||
/* first item added must be a label */
|
||||
Assert(ns_top != NULL || itemtype == PLPGSQL_NSTYPE_LABEL);
|
||||
|
||||
nse = palloc(sizeof(PLpgSQL_nsitem) + strlen(name));
|
||||
nse = palloc(offsetof(PLpgSQL_nsitem, name) +strlen(name) + 1);
|
||||
nse->itemtype = itemtype;
|
||||
nse->itemno = itemno;
|
||||
nse->prev = ns_top;
|
||||
|
@@ -329,7 +329,7 @@ typedef struct PLpgSQL_nsitem
|
||||
int itemtype;
|
||||
int itemno;
|
||||
struct PLpgSQL_nsitem *prev;
|
||||
char name[1]; /* actually, as long as needed */
|
||||
char name[FLEXIBLE_ARRAY_MEMBER]; /* nul-terminated string */
|
||||
} PLpgSQL_nsitem;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user