https://issues.shibboleth.net/jira/browse/SSPCPP-514
authorScott Cantor <cantor.2@osu.edu>
Mon, 8 Oct 2012 18:31:14 +0000 (18:31 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 8 Oct 2012 18:31:14 +0000 (18:31 +0000)
fastcgi/shibresponder.cpp

index 5783f4b..e23bf58 100644 (file)
@@ -248,10 +248,11 @@ static long gstdin(FCGX_Request* request, char** content)
         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