More sanity checks when reading packets

To keep Coverity happy