buglwIP - A Lightweight TCP/IP stack - Bugs: bug #59325, Wrong SSI tag handling if tag...


You are not allowed to post comments on this tracker with your current authentication level.

bug #59325: Wrong SSI tag handling if tag places on the edge of 2920 buffer and LWIP_HTTPD_SSI_INCLUDE_TAG = 0

Submitted by:  Dmitry <gdi>
Submitted on:  Fri 23 Oct 2020 02:03:41 PM UTC  
Category:  Contrib Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
lwIP version:  2.0.0

Fri 23 Oct 2020 02:03:41 PM UTC, original submission:  

Issue related to Bugs #50844 & #50845 which I reported earlier.
I found new issue here.
Settings on test system:
HTML files are placed on SD-Card using FatFs
'val' variable returns 0.000000 text in my case.

If starting tag '<' of any regular HTML tag will be the last symbol in 2920 bytes buffer we will think that it is starting tag for SSI inclusion. And this symbol will be lost when the buffer will be re loaded with next data. Thus HTML tag will be broken.
<div value="<!--#val-->"></div>
will be replaced with
<div value="0.000000>">/div> <-- broken closing DIV

The same situation if we have comment tags (<!-- -->) in HTML code. Actually I didn't test it on initial code, but after my first patch comment
can be replaced with
depending on a position of this tag in a file. This is fixed in second patch.

I've made test.shtml file (see attachments) which cover all possible cases (from my point of view). You'll need to check the source of page in browser.

And also I've attached two patches which fix the issue.

Dmitry <gdi>


Attached Files
file #50072:  test.shtml added by gdi (60KiB - text/html)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gdi (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-23 gdi Attached File- => Added test.shtml, #50072
        Attached File- => Added 0001-Fix-HTML-tag-on-the-edge-of-2920-buffer-issue.patch, #50073
        Attached File- => Added 0002-Fix-SSI-tag-handling-in-case-of-tag-starts-at-the-ed.patch, #50074

    Back to the top

    Powered by Savane 3.7