979ee0
From 006986b0f004b4cdbc3620b417d5a7f62931ecb6 Mon Sep 17 00:00:00 2001
979ee0
From: Robbie Harwood <rharwood@redhat.com>
979ee0
Date: Wed, 30 May 2018 14:54:54 -0400
979ee0
Subject: [PATCH] Fix elements not being removed in otpd_queue_pop_msgid()
979ee0
979ee0
If the element being removed were not the queue head,
979ee0
otpd_queue_pop_msgid() would not actually remove the element, leading
979ee0
to potential double frees and request replays.
979ee0
979ee0
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
979ee0
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
979ee0
---
979ee0
 daemons/ipa-otpd/queue.c | 2 +-
979ee0
 1 file changed, 1 insertion(+), 1 deletion(-)
979ee0
979ee0
diff --git a/daemons/ipa-otpd/queue.c b/daemons/ipa-otpd/queue.c
979ee0
index 730bbc40b864b9dc65a69049c0a0e516e3daac0e..9e29fb238d5c7a7395bcf3860ce7445c27ca98ac 100644
979ee0
--- a/daemons/ipa-otpd/queue.c
979ee0
+++ b/daemons/ipa-otpd/queue.c
979ee0
@@ -155,7 +155,7 @@ struct otpd_queue_item *otpd_queue_pop_msgid(struct otpd_queue *q, int msgid)
979ee0
 
979ee0
     for (item = q->head, prev = &q->head;
979ee0
          item != NULL;
979ee0
-         item = item->next, prev = &item->next) {
979ee0
+         prev = &item->next, item = item->next) {
979ee0
         if (item->msgid == msgid) {
979ee0
             *prev = item->next;
979ee0
             if (q->head == NULL)
979ee0
-- 
979ee0
2.17.1
979ee0