From e3e1c248bdd158d3db3cc0e174c723648d41c24b Mon Sep 17 00:00:00 2001 From: Hans-Joerg Hoexer Date: Sun, 14 Mar 2004 23:26:12 +0000 Subject: Return EINVAL in case of a zero length descriptor. The hifn can not handle this. ok jason@ deraadt@ --- sys/dev/pci/hifn7751.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sys/dev/pci/hifn7751.c') diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index 73198d210e1..4732c93f4c1 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hifn7751.c,v 1.147 2004/02/03 17:17:33 deraadt Exp $ */ +/* $OpenBSD: hifn7751.c,v 1.148 2004/03/14 23:26:11 hshoexer Exp $ */ /* * Invertex AEON / Hifn 7751 driver @@ -1952,6 +1952,11 @@ hifn_process(struct cryptop *crp) return (EINVAL); } + if (crp->crp_ilen == 0) { + err = EINVAL; + goto errout; + } + card = HIFN_CARD(crp->crp_sid); if (card >= hifn_cd.cd_ndevs || hifn_cd.cd_devs[card] == NULL) { err = EINVAL; -- cgit v1.2.3