|
From: | Dmitry |
Subject: | [lwip-devel] [bug #50844] Wrong SSI tag handling if tag ends exactly at the end of 2xMSS buffer |
Date: | Fri, 21 Apr 2017 03:31:18 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 |
URL: <http://savannah.nongnu.org/bugs/?50844> Summary: Wrong SSI tag handling if tag ends exactly at the end of 2xMSS buffer Project: lwIP - A Lightweight TCP/IP stack Submitted by: gdi Submitted on: Fri 21 Apr 2017 07:31:17 AM UTC Category: apps Severity: 3 - Normal Item Group: Faulty Behaviour Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: 1.4.1 _______________________________________________________ Details: I found a trouble in SSI handling in httpsever_raw application of lwip v1.4.1 and the same issue presented in v2.0.x too. The issue is appeared if you have a long *.shtml file which size more of equal to 5840 bytes and if you have SSI tag which will has its closing '>' symbol in a 5840-th byte. In this case the hs->tag_state will switch to TAG_SENDING state and we will go to a next revolution of 'while' loop. But the hs->parse_left = 0 here and we will go out of loop without sending this last tag. And we won't send the continue of *shtml file too. It will ends here. I've catch this situation in debugger see the attachment. I'm also found a solution: I've add the checking for a TAG_SENDING state to the loop expression. /* We have sent all the data that was already parsed so continue parsing * the buffer contents looking for SSI tags. */ while((hs->tag_state == TAG_SENDING) || (hs->parse_left) && (err == ERR_OK)) { The same fix can be applied in appropriate place in lwip v2.0.x httpd example. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Fri 21 Apr 2017 07:31:17 AM UTC Name: hs-last-tag.png Size: 50kB By: gdi <http://savannah.nongnu.org/bugs/download.php?file_id=40461> _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?50844> _______________________________________________ Message sent via/by Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |