postgres.git / summary / log / commit / refs
commit 2c1c4b060c4381a83dd0500a73b26eb7dea4c693
Author: Michael Meskes <meskes@postgresql.org>
Date: Sat Jan 13 13:56:49 2018 +0000
Cope with indicator arrays that do not have the correct length.
Patch by: "Rader, David" <davidr@openscg.com>
src/interfaces/ecpg/preproc/type.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/interfaces/ecpg/preproc/type.c b/src/interfaces/ecpg/preproc/type.c
index 6c2645965ee..9d59167750d 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);
[parent: 8b0e5e7e7cf0]