Bug fix and test for case when UDP packet is corrupted/truncated and
provides the wrong length.