if (clen > STDIN_MAX)
clen = STDIN_MAX;
- *content = new char[clen];
+ *content = new char[clen + 1];
cin.read(*content, clen);
clen = cin.gcount();
+ (*content)[clen] = 0;
}
else {
// *never* read stdin when CONTENT_LENGTH is missing or unparsable
// Although FastCGI supports writing before reading,
// many http clients (browsers) don't support it (so
// the connection deadlocks until a timeout expires!).
- char* content;
+ char* content = nullptr;
gstdin(&request, &content);
+ auto_arrayptr<char> wrapper(content);
try {
xmltooling::NDC ndc("FastCGI shibresponder");
print_error("<html><body>FastCGI Shibboleth responder caught an exception, check log for details.</body></html>");
}
- delete[] content;
-
// If the output streambufs had non-zero bufsizes and
// were constructed outside of the accept loop (i.e.
// their destructor won't be called here), they would