diff options
| author | Michael Meskes | 2018-01-13 13:56:49 +0000 |
|---|---|---|
| committer | Michael Meskes | 2018-01-15 09:01:15 +0000 |
| commit | f082ef83688b036437e580f42894f674534fdb24 (patch) | |
| tree | 22435ddb499d465dc7c5e0492c647a0a499d63ef | |
| parent | c2a7044a5128a17256c771b545a534c7dccb7736 (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 0b84b8d3c47..3a5993836ac 100644 --- a/src/interfaces/ecpg/preproc/type.c +++ b/src/interfaces/ecpg/preproc/type.c @@ -609,7 +609,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); |
