Prevent access after free to table entry in case when
user deletes partition that not yet created (changes doesn't committed to disk). PR: 148687 Approved by: mav (mentor) MFC after: 7 days
This commit is contained in:
parent
2bacd082bd
commit
733a9e2783
@ -830,14 +830,6 @@ g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
|
||||
entry->gpe_pp = NULL;
|
||||
}
|
||||
|
||||
if (entry->gpe_created) {
|
||||
LIST_REMOVE(entry, gpe_entry);
|
||||
g_free(entry);
|
||||
} else {
|
||||
entry->gpe_modified = 0;
|
||||
entry->gpe_deleted = 1;
|
||||
}
|
||||
|
||||
if (pp != NULL)
|
||||
g_wither_provider(pp, ENXIO);
|
||||
|
||||
@ -850,6 +842,14 @@ g_part_ctl_delete(struct gctl_req *req, struct g_part_parms *gpp)
|
||||
gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1);
|
||||
sbuf_delete(sb);
|
||||
}
|
||||
|
||||
if (entry->gpe_created) {
|
||||
LIST_REMOVE(entry, gpe_entry);
|
||||
g_free(entry);
|
||||
} else {
|
||||
entry->gpe_modified = 0;
|
||||
entry->gpe_deleted = 1;
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user