Check some unsanitized network inputs before allocating memory using them.