lwIP - 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
Submitter: | Dmitry <gdi> | ||
Submitted: | 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 |
Attached Files
file #50073: 0001-Fix-HTML-tag-on-the-edge-of-2920-buffer-issue.patch added by gdi (2KiB - application/octet-stream)
file #50074: 0002-Fix-SSI-tag-handling-in-case-of-tag-starts-at-the-ed.patch added by gdi (1KiB - application/octet-stream)
Depends on the following items: None found
Items that depend on this one: None found
Carbon-Copy List
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
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 |
Powered by Savane 3.13-758e.
Corresponding source code
Issue related to Bugs #50844 & #50845 which I reported earlier.
I found new issue here.
Settings on test system:
#define LWIP_HTTPD_DYNAMIC_FILE_READ 1
#define LWIP_HTTPD_SSI_INCLUDE_TAG 0
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
<!--comment-->
can be replaced with
<!--!--comment-->
or
<!----comment-->
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.