extract.c: check for empty extraction list
authorEric Biggers <ebiggers3@gmail.com>
Wed, 28 Jan 2015 02:58:28 +0000 (20:58 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 29 Jan 2015 02:30:38 +0000 (20:30 -0600)
src/extract.c

index 9d65bef8f5c2443e6928b95caa0e19ebf7ae5c28..c61dac764dfc612e36872c099100ca0c643af58f 100644 (file)
@@ -1473,6 +1473,11 @@ extract_trees(WIMStruct *wim, struct wim_dentry **trees, size_t num_trees,
        if (ret)
                goto out_cleanup;
 
+       if (unlikely(list_empty(&dentry_list))) {
+               WARNING("There is nothing to extract!");
+               goto out_cleanup;
+       }
+
        ret = dentry_list_resolve_streams(&dentry_list, ctx);
        if (ret)
                goto out_cleanup;