lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [PATCH][dev15] two memory errors


From: John Bley
Subject: lynx-dev [PATCH][dev15] two memory errors
Date: Mon, 22 Nov 1999 07:28:14 -0500

* Fix an array boundary accident in GridText.c - JB
* Fix an uninitialized member in TRSTable.c - KW, JB

On the first one, I'm not entirely sure if the original intent behind
checking the next character was correct, but this patch at least
ensures that the next character is 'there'.

[patch attached for ease of patching]

diff -Burp lynx2-8-3/src/GridText.c lynx2-8-3-patched/src/GridText.c
--- lynx2-8-3/src/GridText.c    Wed Nov 17 23:08:08 1999
+++ lynx2-8-3-patched/src/GridText.c    Mon Nov 22 07:16:14 1999
@@ -7345,8 +7345,10 @@ PUBLIC void print_wwwfile_to_fd ARGS2(

     line = HTMainText->last_line->next;
     for (;; line = line->next) {
-       if (!first
-        && line->data[0] != LY_SOFT_NEWLINE && line->data[1] != 
LY_SOFT_NEWLINE)
{
+       if (!first &&
+        line->data[0] != LY_SOFT_NEWLINE &&
+        line->data[0] != '\0' &&
+        line->data[1] != LY_SOFT_NEWLINE) {
            /* data[0] can be LY_*START_CHAR, so LY_SOFT_NEWLINE can be in [1] -
VH */
            fputc('\n',fp);
            /*
diff -Burp lynx2-8-3/src/TRSTable.c lynx2-8-3-patched/src/TRSTable.c
--- lynx2-8-3/src/TRSTable.c    Wed Nov 17 23:08:08 1999
+++ lynx2-8-3-patched/src/TRSTable.c    Mon Nov 22 06:52:56 1999
@@ -447,6 +447,7 @@ PRIVATE int Stbl_addCellToRow ARGS9(
        me->cells[i].alignment = HT_LEFT;
     }
     me->cells[me->ncells + colspan].pos = -1; /* not yet used */
+    me->cells[me->ncells + colspan].alignment = HT_ALIGN_NONE;
     me->ncells++;
     return (me->ncells - 1);
 }



--
John Bley
address@hidden
  "Inquisitors create heretics." - Umberto Eco

Attachment: patch-dev15.txt
Description: Text document


reply via email to

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