fix checker for unreasonable size of vector of bools

This commit is contained in:
Seth Alves 2016-11-03 09:47:24 -07:00
parent cfea3cba9b
commit 1d0c3d7168

View file

@ -730,7 +730,7 @@ int OctreePacketData::unpackDataFromBytes(const unsigned char* dataBytes, QVecto
uint16_t length;
memcpy(&length, dataBytes, sizeof(uint16_t));
dataBytes += sizeof(length);
if (length * sizeof(bool) > MAX_OCTREE_UNCOMRESSED_PACKET_SIZE) {
if (length / 8 > MAX_OCTREE_UNCOMRESSED_PACKET_SIZE) {
result.resize(0);
return sizeof(uint16_t);
}