diff options
author | Michael Meskes <meskes@postgresql.org> | 2018-01-13 14:56:49 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2018-01-15 10:02:23 +0100 |
commit | a0f5890a64e8a5d593b762183682b73ea72f2fe1 (patch) | |
tree | bb989d93083cfeef1646236ecdf5a38dcff8e0ee | |
parent | 4e71700584de1e7db6b05257f61dc643e4bea2bf (diff) |
Cope with indicator arrays that do not have the correct length.
Patch by: "Rader, David" <davidr@openscg.com>
-rw-r--r-- | src/interfaces/ecpg/preproc/type.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c index 3e37fb9d3c1..d6c4b959d53 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -560,7 +560,17 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz, prefix, ind_prefix, arrsiz, type->struct_sizeof, (ind_p != NULL) ? ind_type->struct_sizeof : NULL); if (ind_p != NULL && ind_p != &struct_no_indicator) + { ind_p = ind_p->next; + if (ind_p == NULL && p->next != NULL) { + mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too few members", ind_name); + ind_p = &struct_no_indicator; + } + } + } + + if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator) { + mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too many members", ind_name); } free(pbuf); |