]> Zhao Yanbai Git Server - minix.git/commitdiff
libvtreefs: allow highly dynamic directories 14/3014/1
authorCristiano Giuffrida <giuffrida@cs.vu.nl>
Thu, 1 Jan 2015 15:34:13 +0000 (16:34 +0100)
committerDavid van Moolenbroek <david@minix3.org>
Mon, 29 Jun 2015 10:57:31 +0000 (10:57 +0000)
Change-Id: Ibf76262f943ef1a5f529384ebd4a06a2cc5897c1

minix/lib/libvtreefs/inode.c

index 6ad4a4bee376de4651a4d7db1afb8701b7a7b02a..925fca2650c8910808e0819b704ffcb01480c066 100644 (file)
@@ -432,7 +432,10 @@ get_inode_by_index(const struct inode * parent, index_t index)
 
        CHECK_INODE(parent);
        assert(S_ISDIR(parent->i_stat.mode));
-       assert(index >= 0 && index < parent->i_indexed);
+       assert(index >= 0);
+
+       if (index >= parent->i_indexed)
+               return NULL;
 
        /* Get the hash value, and search for the inode. */
        slot = parent_index_hash(parent, index);