HTTPD bug fix which is caused by stack overflow.
Dependents: mbed_controller_demo
Fork of HTTPD by
Original HTTPD implementation of Suga koubou is great but has some bug inside unfortunately. The most critical bug was accessing buffer with the index of out of range like following.
problematic code
char buf[256]; n = httpd->_state[id].client->receive(buf, sizeof(buf)); buf[n] =0;
With above code, it could set buf[256] = 0 when more that 255 data is received. Setting buf[256] causes some other area of memory is corrupted so that system can be predictive status since than.
bug fixed code
n = httpd->_state[id].client->receive(buf, sizeof(buf)-1); buf[n] =0;
Files at revision 2:584ce0a1a76e
Name | Size | Actions |
---|---|---|
[up] | ||
CBuffer.h | 2184 | Revisions Annotate |
HTTPD.cpp | 4765 | Revisions Annotate |
HTTPD.h | 5687 | Revisions Annotate |
HTTPD_req.cpp | 10909 | Revisions Annotate |
HTTPD_util.cpp | 7463 | Revisions Annotate |
HTTPD_ws.cpp | 6752 | Revisions Annotate |
sha1.cpp | 9673 | Revisions Annotate |
sha1.h | 2169 | Revisions Annotate |