Handle too big numbers given in the max size argument.

This commit is contained in:
jmmv 2005-09-26 09:50:08 +00:00
parent a42b78b9cc
commit 90260ab291

View File

@ -1,4 +1,4 @@
/* $NetBSD: tmpfs_vfsops.c,v 1.8 2005/09/25 16:34:42 jmmv Exp $ */
/* $NetBSD: tmpfs_vfsops.c,v 1.9 2005/09/26 09:50:08 jmmv Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.8 2005/09/25 16:34:42 jmmv Exp $");
__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.9 2005/09/26 09:50:08 jmmv Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -141,7 +141,7 @@ tmpfs_mount(struct mount *mp, const char *path, void *data,
* allowed to use, based on the maximum size the user passed in
* the mount structure. A value of zero is treated as if the
* maximum available space was requested. */
if (args.ta_size_max < PAGE_SIZE)
if (args.ta_size_max < PAGE_SIZE || args.ta_size_max >= SIZE_MAX)
pages = SIZE_MAX;
else
pages = args.ta_size_max / PAGE_SIZE +