security.c: Rewrite some code
[wimlib] / src / verify.c
index eef45d3ce3ee29eae902c9834302c8f0313964a2..89da4b8dff999d0e35b2312ee6297a5ea61186b7 100644 (file)
@@ -52,7 +52,9 @@ verify_inode(struct wim_inode *inode, const WIMStruct *w)
                goto out;
        }
 
-       if (inode->i_security_id >= sd->num_entries) {
+       if (inode->i_security_id >= 0 &&
+           inode->i_security_id >= sd->num_entries)
+       {
                ERROR("Dentry `%"TS"' has an invalid security ID (%d) "
                      "(there are only %u entries in the security table)",
                      dentry_full_path(first_dentry), inode->i_security_id,