win32_capture: correctly handle unspecified security IDs in MFT
authorEric Biggers <ebiggers3@gmail.com>
Fri, 22 Jan 2016 04:58:16 +0000 (22:58 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 22 Jan 2016 06:07:39 +0000 (00:07 -0600)
src/win32_capture.c

index ef7d118..786756f 100644 (file)
@@ -2477,6 +2477,9 @@ security_map_lookup(struct security_map *map, u32 disk_security_id)
        struct security_map_node tmp;
        const struct avl_tree_node *res;
 
+       if (disk_security_id == 0)  /* No on-disk security ID; uncacheable  */
+               return -1;
+
        tmp.disk_security_id = disk_security_id;
        res = avl_tree_lookup_node(map->root, &tmp.index_node,
                                   _avl_cmp_security_map_nodes);
@@ -2491,6 +2494,9 @@ security_map_insert(struct security_map *map, u32 disk_security_id,
 {
        struct security_map_node *node;
 
+       if (disk_security_id == 0)  /* No on-disk security ID; uncacheable  */
+               return 0;
+
        node = MALLOC(sizeof(*node));
        if (!node)
                return WIMLIB_ERR_NOMEM;