[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] libblktapctl: fix use-after-free bug
# HG changeset patch # User Gianni Tedesco <gianni.tedesco@xxxxxxxxxx> # Date 1280853248 -3600 # Node ID 266df0bf4a0df8972dba8d47542401c85c5d617b # Parent 6b9e44cf2651bbecdc03e291fde1ac0dc4bf9263 libblktapctl: fix use-after-free bug This has not caused crashes because generally use after free is OK provided nothing else is going on. However the patch makes things correct. It also allows us to use heap poisoning feature of valgrind on tools linking to libblktapctl. Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> --- tools/blktap2/control/tap-ctl-list.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -r 6b9e44cf2651 -r 266df0bf4a0d tools/blktap2/control/tap-ctl-list.c --- a/tools/blktap2/control/tap-ctl-list.c Tue Aug 03 17:14:06 2010 +0100 +++ b/tools/blktap2/control/tap-ctl-list.c Tue Aug 03 17:34:08 2010 +0100 @@ -385,9 +385,9 @@ _tap_ctl_free_tapdisks(struct tapdisk *t struct tapdisk *tap; for (tap = tapv; tap < &tapv[n_taps]; ++tap) { - struct tapdisk_list *tl; - - list_for_each_entry(tl, &tap->list, entry) { + struct tapdisk_list *tl, *next; + + list_for_each_entry_safe(tl, next, &tap->list, entry) { free(tl->params); free(tl); } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |