ugorji/go-msgpack — pull request #7 by dgryski (2012-06-11 22:07:49+00:00)
Title: decode: prevent panic when unserializing integers of the wrong signedness

The msgpack C code generates signed (0xd0..0xd3) or unsigned
(0xcc..0xcf) integers depending on the actual *value* being encoded,
regardless of the type of the original variable. Thus, a serialized
object that has an integer field may recieve either an int or a
uint. If we fail to guess correctly, Unmarshal panics.

This patch treats all integer types as semi-equivalent, and we call
the appropriate SetInt or SetUint routine depending on the target
type.