lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV error recovery for form parsing


From: Klaus Weide
Subject: Re: LYNX-DEV error recovery for form parsing
Date: Mon, 7 Apr 1997 20:07:59 -0500 (CDT)

On Mon, 7 Apr 1997, Foteos Macrides wrote:

> Laura Eaves <address@hidden> wrote:
> >[...]
> >
> >Anyway, looking at HTML_end_element(), I did notice some minor oversights
> >and made a couple of 1-line changes that I think could be added to your
> >patch....  Diff included below for your  perusal.
> >[...]
> 
>       The important thing is to exercise the patch to see if it's
> still as crash safe as the vanilla v2.7.1 for bad HTML affecting
> FORM markup.   It probably is, but it's impossible to think through
> all possible consequences of bad HTML in one's head, and it took
> two years of tweaking to make the FORM code as crash safe from bad
> HTML as it is in the formal releases.

I have yet another small variation (which I put in my code but haven't
tested much).  It consists of replacing the test(s) for

    (element_number != HTML_FORM)

at the beginning of HTML_end_element(), in the stack-popping code, with
testing for

    (HTML_dtd.tags[element_number].contents != SGML_EMPTY)

instead, i.e.

 .....
    /*
     *  Pop state off stack if it's not a FORM end tag. - FM
     */
    if (HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
        if (me->sp < me->stack + MAX_NESTING+1) {
            (me->sp)++;
            if (TRACE)
                fprintf(stderr,
                        "HTML:end_element: Popped style off stack - %s\n",
                        me->sp->style->name);
        } else {
 .....

This is the same test that is used in the corresponding stack-*pushing*
code in HTML_start_element(), and it *should* be equivalent to testing
just for HTML_FORM, since HTML_FORM is currently the only element
declared SGML_EMPTY which can possibly result in a call to
HTML_end_element() - right?

If this is wrong, I would appreciate a correction.

  Klaus

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]