9e4ed37219
Check errno and handle it as invalid input. Obtained from: HardenedBSD Submitted by: David CARLIER <devnexen@gmail.com> MFC after: 2 weeks