diff options
author | Roger Meier <roger@apache.org> | 2012-10-04 18:02:15 +0000 |
---|---|---|
committer | Roger Meier <roger@apache.org> | 2012-10-04 18:02:15 +0000 |
commit | b69d24dbf71176bff8b8ad6cf4f59605c9cdd322 (patch) | |
tree | 0c5c35bae9e3f04a977f204c4a4fa4ee423045aa /lib/cpp/src/thrift/transport/THttpServer.cpp | |
parent | bd5db3aa702952615f26516a4c9d6e9e16e63a0b (diff) | |
download | thrift-b69d24dbf71176bff8b8ad6cf4f59605c9cdd322.tar.gz |
THRIFT-1690 Sockets and Pipe Handles truncated on Win64
Patch: Ben Craig
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1394182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'lib/cpp/src/thrift/transport/THttpServer.cpp')
-rw-r--r-- | lib/cpp/src/thrift/transport/THttpServer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/cpp/src/thrift/transport/THttpServer.cpp b/lib/cpp/src/thrift/transport/THttpServer.cpp index d72319679..1b3fe7bcb 100644 --- a/lib/cpp/src/thrift/transport/THttpServer.cpp +++ b/lib/cpp/src/thrift/transport/THttpServer.cpp @@ -39,7 +39,7 @@ void THttpServer::parseHeader(char* header) { if (colon == NULL) { return; } - uint32_t sz = colon - header; + size_t sz = colon - header; char* value = colon+1; if (strncmp(header, "Transfer-Encoding", sz) == 0) { @@ -96,7 +96,8 @@ void THttpServer::flush() { string header = h.str(); // Write the header, then the data, then flush - transport_->write((const uint8_t*)header.c_str(), header.size()); + // cast should be fine, because none of "header" is under attacker control + transport_->write((const uint8_t*)header.c_str(), static_cast<uint32_t>(header.size())); transport_->write(buf, len); transport_->flush(); |