From: Cristiano Giuffrida Date: Thu, 1 Jan 2015 15:34:13 +0000 (+0100) Subject: libvtreefs: allow highly dynamic directories X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=64d15bd98e384bdf981da08d8d6c43d136d8fd96;p=minix.git libvtreefs: allow highly dynamic directories Change-Id: Ibf76262f943ef1a5f529384ebd4a06a2cc5897c1 --- diff --git a/minix/lib/libvtreefs/inode.c b/minix/lib/libvtreefs/inode.c index 6ad4a4bee..925fca265 100644 --- a/minix/lib/libvtreefs/inode.c +++ b/minix/lib/libvtreefs/inode.c @@ -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);