Home
       check for balance between BEGIN: and END: - ics2txt - convert icalendar .ics file to plain text
  HTML git clone git://bitreich.org/ics2txt git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/ics2txt
   DIR Log
   DIR Files
   DIR Refs
   DIR Tags
   DIR README
       ---
   DIR commit 58d91e5e80aea1ab98f675ccc4530f26a9659162
   DIR parent 92a5d0067b717710eb607c0465a8a60d4b4c8655
  HTML Author: Josuah Demangeon <me@josuah.net>
       Date:   Wed, 16 Jun 2021 23:17:45 +0200
       
       check for balance between BEGIN: and END:
       
       Diffstat:
         M ical.c                              |       7 +++++++
       
       1 file changed, 7 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/ical.c b/ical.c
       @@ -156,6 +156,8 @@ hook_block_begin(IcalParser *p, char *name)
        static int
        hook_block_end(IcalParser *p, char *name)
        {
       +        if (p->current == p->stack)
       +                return ical_err(p, "more END: than BEGIN:");
                if (strcasecmp(p->current->name, name) != 0)
                        return ical_err(p, "mismatching BEGIN: and END:");
                p->current--;
       @@ -319,7 +321,12 @@ ical_parse(IcalParser *p, FILE *fp)
                        }
                        p->linenum += l;
                } while        (l > 0 && (err = ical_parse_contentline(p, contentline)) == 0);
       +
                free(contentline);
                free(line);
       +
       +        if (err == 0 && p->current != p->stack)
       +                return ical_err(p, "more BEGIN: than END:");
       +
                return err;
        }