Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c4fcab2

Browse filesBrowse files
authored
Fix issue espressif#5506 "WebServer serveStatic () can cause LoadProhibited exception in _svfprintf_r" (espressif#5508)
"Using a Core Debug Level of Verbose and the WebServer serveStatic() function with the default value of nullptr for its cache_header argument, results in a LoadProhibited exception in _svfprintf_r(). This is because serveStatic() calls log_v() with cache_header corresponding to a "%s" in its format but without checking that cache_header is not nullptr, and then logv() (indirectly) calls _svfprintf_r(). On the other hand, with a Core Debug Level other than Verbose, this does not occur." Changed serveStatic() to the check value of cache_header and if it is nullptr, instead pass an empty string to log_v().
1 parent 0acbe78 commit c4fcab2
Copy full SHA for c4fcab2

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎libraries/WebServer/src/detail/RequestHandlersImpl.h

Copy file name to clipboardExpand all lines: libraries/WebServer/src/detail/RequestHandlersImpl.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class StaticRequestHandler : public RequestHandler {
6969
, _cache_header(cache_header)
7070
{
7171
_isFile = fs.exists(path);
72-
log_v("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header);
72+
log_v("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header ? cache_header : ""); // issue 5506 - cache_header can be nullptr
7373
_baseUriLength = _uri.length();
7474
}
7575

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.