summaryrefslogtreecommitdiff
path: root/sys/dev/pci/hifn7751.c
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2004-03-14 23:26:12 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2004-03-14 23:26:12 +0000
commite3e1c248bdd158d3db3cc0e174c723648d41c24b (patch)
treef9fb756441c6b05a42d454c3e73df7c0cebd840c /sys/dev/pci/hifn7751.c
parentd4e51de0ee16c9d166ff7880e62f7a753c1aef55 (diff)
Return EINVAL in case of a zero length descriptor. The hifn can not handle
this. ok jason@ deraadt@
Diffstat (limited to 'sys/dev/pci/hifn7751.c')
-rw-r--r--sys/dev/pci/hifn7751.c7
1 files changed, 6 insertions, 1 deletions
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;