Skip to content

Commit a0f5890

Browse files
author
Michael Meskes
committed
Cope with indicator arrays that do not have the correct length.
Patch by: "Rader, David" <davidr@openscg.com>
1 parent 4e71700 commit a0f5890

File tree

1 file changed

+10
-0
lines changed
  • src/interfaces/ecpg/preproc

1 file changed

+10
-0
lines changed

src/interfaces/ecpg/preproc/type.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,17 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, char *arrsiz,
560560
prefix, ind_prefix, arrsiz, type->struct_sizeof,
561561
(ind_p != NULL) ? ind_type->struct_sizeof : NULL);
562562
if (ind_p != NULL && ind_p != &struct_no_indicator)
563+
{
563564
ind_p = ind_p->next;
565+
if (ind_p == NULL && p->next != NULL) {
566+
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too few members", ind_name);
567+
ind_p = &struct_no_indicator;
568+
}
569+
}
570+
}
571+
572+
if (ind_type != NULL && ind_p != NULL && ind_p != &struct_no_indicator) {
573+
mmerror(PARSE_ERROR, ET_WARNING, "indicator struct \"%s\" has too many members", ind_name);
564574
}
565575

566576
free(pbuf);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy