Fix integer conversion issue that may lead to exception or DoS
Fix integer conversion issue that may lead to exception or DoS

Summary:
When processing the header we read a uint16_t, then cast it into a int16_t and then use the signed value to resize a vector

When the signed value is negative (e.g. when the unsigned value is something like 0xffff), then the resize function will throw an exception or in the worst case cause an oom

Reviewed By: iahs

Differential Revision: D40224044

fbshipit-source-id: cc30280079015f4deb7c4df153556176ba466de6

facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift