FBUnserializer<V>::unserializeThing(size_t depth) {
  if (UNLIKELY(depth > 1024)) {
    throw UnserializeError("depth > 1024");
  }

  size_t code = nextCode();

  switch (code) {
    case FB_SERIALIZE_BYTE:
    case FB_SERIALIZE_I16:
    case FB_SERIALIZE_I32:
    case FB_SERIALIZE_I64:
      return V::fromInt64(unserializeInt64());
    case FB_SERIALIZE_VARCHAR:
    case FB_SERIALIZE_STRING:
      return V::fromString(unserializeString());
    case FB_SERIALIZE_STRUCT:
      return V::fromMap(unserializeMap(depth));
    case FB_SERIALIZE_NULL:
      ++p_;
      return V::createNull();
    case FB_SERIALIZE_DOUBLE:
      return V::fromDouble(unserializeDouble());
    case FB_SERIALIZE_BOOLEAN:
      return V::fromBool(unserializeBoolean());
    case FB_SERIALIZE_VECTOR:
      return V::fromVector(unserializeVector(depth));
    case FB_SERIALIZE_LIST:
      return V::fromVector(unserializeList(depth));
    case FB_SERIALIZE_SET:
      return V::fromSet(unserializeSet(depth));
    default:
      throw UnserializeError("Invalid code: " + folly::to<std::string>(code)
                             + " at location " + folly::to<std::string>(p_));
  }
}
The product does not properly control the amount of recursion which takes place,  consuming excessive resources, such as allocated memory or the program stack.