summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-01-27 08:58:58 +0000
committerglebius <glebius@FreeBSD.org>2012-01-27 08:58:58 +0000
commitac538c830d204a0478f5200a53685c06c1e7f3b2 (patch)
tree7d70026385910ce861e7b14cb92ca9ce77e37f44 /sys/kern/vfs_aio.c
parentb028f4969496180e5f104ad8efb70d435c0c439f (diff)
downloadFreeBSD-src-ac538c830d204a0478f5200a53685c06c1e7f3b2.zip
FreeBSD-src-ac538c830d204a0478f5200a53685c06c1e7f3b2.tar.gz
Fix size check, that prevents getting negative after casting
to a signed type Reviewed by: bde
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index fe682d8..a28b2fa 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -1553,7 +1553,7 @@ aio_aqueue(struct thread *td, struct aiocb *job, struct aioliojob *lj,
}
/* 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);
}
OpenPOWER on IntegriCloud