aboutsummaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2/ibcs2_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_stat.c')
-rw-r--r--sys/i386/ibcs2/ibcs2_stat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/i386/ibcs2/ibcs2_stat.c b/sys/i386/ibcs2/ibcs2_stat.c
index d3bf6ae077d2..55fa8d5601b8 100644
--- a/sys/i386/ibcs2/ibcs2_stat.c
+++ b/sys/i386/ibcs2/ibcs2_stat.c
@@ -25,6 +25,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+static const char rcsid[] =
+"$FreeBSD$";
#include <sys/param.h>
#include <sys/systm.h>
@@ -78,6 +80,10 @@ cvt_statfs(sp, buf, len)
{
struct ibcs2_statfs ssfs;
+ if (len < 0)
+ return (EINVAL);
+ else if (len > sizeof(ssfs))
+ len = sizeof(ssfs);
bzero(&ssfs, sizeof ssfs);
ssfs.f_fstyp = 0;
ssfs.f_bsize = sp->f_bsize;