URL: https://github.com/freeipa/freeipa/pull/1980
Author: frozencemetery
 Title: #1980: Fix elements not being removed in otpd_queue_pop_msgid()
Action: opened

PR body:
"""
If the element being removed were not the queue head,
otpd_queue_pop_msgid() would not actually remove the element, leading
to potential double frees and request replays.
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1980/head:pr1980
git checkout pr1980
From 7c1729d5e0d5c71804a31f296a508ad05d1f8a90 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharw...@redhat.com>
Date: Wed, 30 May 2018 14:54:54 -0400
Subject: [PATCH] Fix elements not being removed in otpd_queue_pop_msgid()

If the element being removed were not the queue head,
otpd_queue_pop_msgid() would not actually remove the element, leading
to potential double frees and request replays.
---
 daemons/ipa-otpd/queue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/daemons/ipa-otpd/queue.c b/daemons/ipa-otpd/queue.c
index 730bbc40b8..9e29fb238d 100644
--- a/daemons/ipa-otpd/queue.c
+++ b/daemons/ipa-otpd/queue.c
@@ -155,7 +155,7 @@ struct otpd_queue_item *otpd_queue_pop_msgid(struct otpd_queue *q, int msgid)
 
     for (item = q->head, prev = &q->head;
          item != NULL;
-         item = item->next, prev = &item->next) {
+         prev = &item->next, item = item->next) {
         if (item->msgid == msgid) {
             *prev = item->next;
             if (q->head == NULL)
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/freeipa-devel@lists.fedorahosted.org/message/RDEVJGA5CHY7WWWCALCC3BOQFDWAM5XU/

Reply via email to