Author: glebius
Date: Fri Jan 27 08:58:58 2012
New Revision: 230610
URL: http://svn.freebsd.org/changeset/base/230610

Log:
  Fix size check, that prevents getting negative after casting
  to a signed type
  
  Reviewed by:  bde

Modified:
  head/sys/kern/vfs_aio.c

Modified: head/sys/kern/vfs_aio.c
==============================================================================
--- head/sys/kern/vfs_aio.c     Fri Jan 27 08:46:32 2012        (r230609)
+++ head/sys/kern/vfs_aio.c     Fri Jan 27 08:58:58 2012        (r230610)
@@ -1553,7 +1553,7 @@ aio_aqueue(struct thread *td, struct aio
        }
 
        /* XXX: aio_nbytes is later casted to signed types. */
-       if ((int)aiocbe->uaiocb.aio_nbytes < 0) {
+       if (aiocbe->uaiocb.aio_nbytes > INT_MAX) {
                uma_zfree(aiocb_zone, aiocbe);
                return (EINVAL);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to