Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
OCaml 3.10.2 (32-bit)
Description
TBinaryProtocol.ml contains integers outside the range of 32-bit OCaml's native int type (specifically the version_mask and version_1). Additionally, when reading int32s off of the network it returns them as OCaml-native ints. This will behave wrong when an int >= 2**30 is sent over the network, as that will wrap on the OCaml side. I assume the author of this code used 64-bit OCaml, as the code won't even compile under 32-bit OCaml right now.
In TBinaryProtocol 64-bit ints are kept as int64 objects. The same should be done with 32-bit int values.