Always check if the length of the packet is valid before doing stuff with it.