Github user hcorg commented on a diff in the pull request: https://github.com/apache/thrift/pull/1128#discussion_r88791711 --- Diff: lib/cpp/src/thrift/transport/THeaderTransport.h --- @@ -135,8 +142,12 @@ class THeaderTransport : public TVirtualTransport<THeaderTransport, TFramedTrans void transform(uint8_t* ptr, uint32_t sz); uint16_t getNumTransforms() const { - int trans = writeTrans_.size(); - return trans; + std::vector<uint16_t>::size_type trans = writeTrans_.size(); + if (trans > std::numeric_limits<uint16_t>().max()) { + throw TTransportException(TTransportException::CORRUPTED_DATA, --- End diff -- indent
--- 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. ---