From 47714584327a9a8240f28e8ef4493534a1d047ba Mon Sep 17 00:00:00 2001 From: David Reiss Date: Fri, 9 May 2008 00:40:26 +0000 Subject: [PATCH] Fix a small logic error in TBufferedTransport::borrowSlow. Was using an unsigned int for a value that could be negative. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665680 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/src/transport/TBufferTransports.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/transport/TBufferTransports.cpp index 9164a1f9..0deef1bf 100644 --- a/lib/cpp/src/transport/TBufferTransports.cpp +++ b/lib/cpp/src/transport/TBufferTransports.cpp @@ -101,7 +101,7 @@ const uint8_t* TBufferedTransport::borrowSlow(uint8_t* buf, uint32_t* len) { // The number of bytes of data we have already. uint32_t have = rBound_ - rBase_; // The number of additional bytes we need from the underlying transport. - uint32_t need = *len - have; + int32_t need = *len - have; // The space from the start of the buffer to the end of our data. uint32_t offset = rBound_ - rBuf_.get(); assert(need > 0); -- 2.17.1