Explorar o código

Fix #686 CivetServer::getPostData valgrind UninitCondition

Ivan Dlugos %!s(int64=6) %!d(string=hai) anos
pai
achega
2a3f39eb90
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      src/CivetServer.cpp

+ 1 - 3
src/CivetServer.cpp

@@ -582,9 +582,7 @@ CivetServer::getPostData(struct mg_connection *conn)
 	char buf[2048];
 	int r = mg_read(conn, buf, sizeof(buf));
 	while (r > 0) {
-		std::string p = std::string(buf);
-		p.resize(r);
-		postdata += p;
+		postdata += std::string(buf, r);
 		r = mg_read(conn, buf, sizeof(buf));
 	}
 	mg_unlock_connection(conn);