Github user jeking3 commented on a diff in the pull request:

    https://github.com/apache/thrift/pull/1326#discussion_r132545680
  
    --- Diff: lib/cpp/src/thrift/transport/TBufferTransports.cpp ---
    @@ -361,9 +361,12 @@ void TMemoryBuffer::ensureCanWrite(uint32_t len) {
       }
     
       // Grow the buffer as necessary.
    -  uint32_t new_size = bufferSize_;
    +  uint64_t new_size = bufferSize_;
       while (len > avail) {
         new_size = new_size > 0 ? new_size * 2 : 1;
    +    if (new_size > std::numeric_limits<uint32_t>::max()) {
    +      throw TTransportException("Internal buffer size exceeded 2GB");
    --- End diff --
    
    I would prefer to see a TTransportException with an error type BAD_ARGS 
here, however it looks like error types are not being used elsewhere in this 
module.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to