aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-11-22 10:54:39 +0000
committerStefan Hajnoczi <stefanha@redhat.com>2016-11-22 10:54:40 +0000
commit06bf33cfe708e9ecaeb3c3d3bb80590991141800 (patch)
tree2c51ef9e653f7f6a95ff563adfb210a666b44e6f
parentab9125c021e0901794dca7c55702d8ee5efd75fa (diff)
parent668c0e441d761a79f33eae11c120e01a29f9d4dd (diff)
Merge remote-tracking branch 'jtc/tags/block-pull-request' into staging
# gpg: Signature made Mon 21 Nov 2016 10:12:43 PM GMT # gpg: using RSA key 0xBDBE7B27C0DE3057 # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>" # gpg: aka "Jeffrey Cody <jeff@codyprime.org>" # gpg: aka "Jeffrey Cody <codyprime@gmail.com>" # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98 D624 BDBE 7B27 C0DE 3057 * jtc/tags/block-pull-request: gluster: Fix use after free in glfs_clear_preopened() Message-id: 1479766499-29972-1-git-send-email-jcody@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--block/gluster.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/gluster.c b/block/gluster.c
index 0ce15f7adc..891c13b7ce 100644
--- a/block/gluster.c
+++ b/block/gluster.c
@@ -239,12 +239,13 @@ static glfs_t *glfs_find_preopened(const char *volume)
static void glfs_clear_preopened(glfs_t *fs)
{
ListElement *entry = NULL;
+ ListElement *next;
if (fs == NULL) {
return;
}
- QLIST_FOREACH(entry, &glfs_list, list) {
+ QLIST_FOREACH_SAFE(entry, &glfs_list, list, next) {
if (entry->saved.fs == fs) {
if (--entry->saved.ref) {
return;