SBuf::c_str() produces a temporary c-string which is not
guaranteed to survive, and does not survive as long as required
to print the deny_info URL. The HttpRequest::url path SBuf has
a much longer lifetime, so use a const reference to it instead.
This was added in
51b5dcf59c93ef76fefacfeae837b076a624596e
along with many other identical uses which have since been
removed by other refactorings.
case 'R':
if (building_deny_info_url) {
if (request != NULL) {
- SBuf tmp = request->url.path();
- p = tmp.c_str();
+ const SBuf &tmp = request->url.path();
+ mb.append(tmp.rawContent(), tmp.length());
no_urlescape = 1;
} else
p = "[no request]";