mirror of
https://git.freebsd.org/ports.git
synced 2025-07-01 17:40:40 -04:00
This change imports three post-1.2.4 release changes from the primary Git repository of Quagga Project: 1) Fix threading error that broke ripd:1f918980c0
2) Fix memory corruption that may occur when limit.rlim_cur is less then FD_SETSIZE:b54de751ef
3) Prevent queue corruption when removing the last entry of queuese21719d8fa
PR: 261205 Approved by: pi (maintainer)
14 lines
484 B
C
14 lines
484 B
C
--- lib/pqueue.c.orig 2018-02-20 04:24:55.000000000 +0700
|
|
+++ lib/pqueue.c 2022-01-15 00:17:05.525677000 +0700
|
|
@@ -172,7 +172,10 @@ pqueue_dequeue (struct pqueue *queue)
|
|
void
|
|
pqueue_remove_at (int index, struct pqueue *queue)
|
|
{
|
|
- queue->array[index] = queue->array[--queue->size];
|
|
+ if (index == --queue->size)
|
|
+ return; /* we're removing the last entry */
|
|
+
|
|
+ queue->array[index] = queue->array[queue->size];
|
|
|
|
if (index > 0
|
|
&& (*queue->cmp) (queue->array[index],
|