Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/tmpfs Handle too big numbers given in the max size ar...



details:   https://anonhg.NetBSD.org/src/rev/2cf4329169cf
branches:  trunk
changeset: 584685:2cf4329169cf
user:      jmmv <jmmv%NetBSD.org@localhost>
date:      Mon Sep 26 09:50:08 2005 +0000

description:
Handle too big numbers given in the max size argument.

diffstat:

 sys/fs/tmpfs/tmpfs_vfsops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 571c6808f5e2 -r 2cf4329169cf sys/fs/tmpfs/tmpfs_vfsops.c
--- a/sys/fs/tmpfs/tmpfs_vfsops.c       Mon Sep 26 09:49:22 2005 +0000
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c       Mon Sep 26 09:50:08 2005 +0000
@@ -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 @@
         * 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 +



Home | Main Index | Thread Index | Old Index