diff options
author | David Howells <[email protected]> | 2014-09-02 13:52:20 +0100 |
---|---|---|
committer | James Morris <[email protected]> | 2014-09-03 10:30:22 +1000 |
commit | 27419604f51a97d497853f14142c1059d46eb597 (patch) | |
tree | e5098e23130775f553e0fe65b9315f288985ad48 | |
parent | 876c6e3e028d1b326c81f6f134a4804b92f67dc7 (diff) |
KEYS: Fix use-after-free in assoc_array_gc()
An edit script should be considered inaccessible by a function once it has
called assoc_array_apply_edit() or assoc_array_cancel_edit().
However, assoc_array_gc() is accessing the edit script just after the
gc_complete: label.
Reported-by: Andreea-Cristina Bernat <[email protected]>
Signed-off-by: David Howells <[email protected]>
Reviewed-by: Andreea-Cristina Bernat <[email protected]>
cc: [email protected]
cc: [email protected]
Cc: [email protected]
Signed-off-by: James Morris <[email protected]>
-rw-r--r-- | lib/assoc_array.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/assoc_array.c b/lib/assoc_array.c index c0b1007011e1..ae146f0734eb 100644 --- a/lib/assoc_array.c +++ b/lib/assoc_array.c @@ -1735,7 +1735,7 @@ ascend_old_tree: gc_complete: edit->set[0].to = new_root; assoc_array_apply_edit(edit); - edit->array->nr_leaves_on_tree = nr_leaves_on_tree; + array->nr_leaves_on_tree = nr_leaves_on_tree; return 0; enomem: |