]> Zhao Yanbai Git Server - minix.git/commitdiff
block-dev:add additional sanity check. 42/842/2
authorKees Jongenburger <kees.jongenburger@gmail.com>
Tue, 24 Sep 2013 11:54:02 +0000 (13:54 +0200)
committerGerrit Code Review <gerrit@gerrit>
Thu, 26 Sep 2013 07:06:57 +0000 (09:06 +0200)
Change-Id: Ib5b7cd93a50726b95c2e1b4c7eeedfefc824dd9c

lib/libbdev/bdev.c

index fb4dfc239916ee8f6158d77efffdba626d9c78e9..b950368f512dfafa471e5831c7ad8c5e51aa3103 100644 (file)
@@ -206,6 +206,7 @@ static int bdev_vrdwt_setup(int req, dev_t dev, u64_t pos, iovec_t *vec,
        gvec[i].iov_grant = grant;
        gvec[i].iov_size = vec[i].iov_size;
 
+       assert(vec[i].iov_size > 0);
        assert((ssize_t) (size + vec[i].iov_size) > size);
 
        size += vec[i].iov_size;