summaryrefslogtreecommitdiff
path: root/sys/compat/ibcs2
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-08-02 18:06:26 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-08-02 18:06:26 +0000
commit3e4903bd6ac871af81bec9d479ba811f3165d939 (patch)
treecaa2f4fec767fcd36d74c4118e31ee76f54e1ead /sys/compat/ibcs2
parent977fa39ace69d23d01d5a62c1c3fda0b55729478 (diff)
More possible int overflows found by Silvio Cesare.
ibcs2_stat.c one OK by provos@
Diffstat (limited to 'sys/compat/ibcs2')
-rw-r--r--sys/compat/ibcs2/ibcs2_stat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/compat/ibcs2/ibcs2_stat.c b/sys/compat/ibcs2/ibcs2_stat.c
index 04534fc0eca..366f49f7a10 100644
--- a/sys/compat/ibcs2/ibcs2_stat.c
+++ b/sys/compat/ibcs2/ibcs2_stat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibcs2_stat.c,v 1.9 2002/03/14 20:31:31 mickey Exp $ */
+/* $OpenBSD: ibcs2_stat.c,v 1.10 2002/08/02 18:06:25 millert Exp $ */
/* $NetBSD: ibcs2_stat.c,v 1.5 1996/05/03 17:05:32 christos Exp $ */
/*
@@ -84,6 +84,11 @@ cvt_statfs(sp, buf, len)
{
struct ibcs2_statfs ssfs;
+ if (len < 0)
+ return (EINVAL);
+ if (len > sizeof(ssfs))
+ len = sizeof(ssfs);
+
bzero(&ssfs, sizeof ssfs);
ssfs.f_fstyp = 0;
ssfs.f_bsize = sp->f_bsize;