lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV parsing stack bounds checking patch


From: Klaus Weide
Subject: LYNX-DEV parsing stack bounds checking patch
Date: Thu, 17 Apr 1997 13:16:14 -0500 (CDT)

On Thu, 17 Apr 1997, Foteos Macrides wrote:

>       I'll be putting out an update later today or tomorrow, but I
> wanted to see the HTML.c stack mods you said were "below" in one of
> of your messages, but weren't, and I assumed you'd put them in a
> subsequent message.

It seems I simply forgot to include the file, after already 
transferring it and everything... :(

Ok, it is below now.  (It was probably not against the latest
fotemods version, but I hope it will still work.  Anyway it
should be easy to locate those two lines.)

>       Anyway, I don't see how you can deal with the problems
> associated with a stack overrun solely in HTML.c.  

I am not tryng to :)

[...] 
>       But if there's some bad logic within the checks for
> an overrun, or pushes and pops within HTML.c, fixes for that
> certainly should be included.

Right, that's all it is, it just corrects the bounds checks
to avoid the crash.  Well I guess a crash can still occur
in other parts of the code, but when I tried it id didn't
happen on that infamous page.
Nothing about trying to keep the two stacks in correspondence,
why bother with details of style and presentation when things 
are so thoroughly messed up...

   Klaus

*** src/HTML.c.orig Wed, 16 Apr 1997 11:48:43 -0600 kweide (Lynx/e/2_HTML.c 
1.1.4.1.1.3 644) version 2.7.1fm-1.2
--- lynx2-7-1/src/HTML.c      Wed, 16 Apr 1997 12:34:22 -0600 kweide
***************
*** 1070,1076 ****
  
      case HTML_CENTER:
      case HTML_DIV:
!       if (me->Division_Level < MAX_NESTING) {
            me->Division_Level++;
        } else if (TRACE) {
              fprintf(stderr, 
--- 1070,1076 ----
  
      case HTML_CENTER:
      case HTML_DIV:
!       if (me->Division_Level < MAX_NESTING - 1) {
            me->Division_Level++;
        } else if (TRACE) {
              fprintf(stderr, 
***************
*** 4365,4371 ****
       *  SGML_EMPTY in HTMLDTD.c. - FM & KW
       */
      if (HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
!         if (me->sp < me->stack + MAX_NESTING+1) {
            (me->sp)++;
            if (TRACE)
                fprintf(stderr,
--- 4365,4371 ----
       *  SGML_EMPTY in HTMLDTD.c. - FM & KW
       */
      if (HTML_dtd.tags[element_number].contents != SGML_EMPTY) {
!         if (me->sp < me->stack + MAX_NESTING-1) {
            (me->sp)++;
            if (TRACE)
                fprintf(stderr,


;
; 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]