summaryrefslogtreecommitdiffstats
path: root/src/basic/prioq.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-10-16 16:35:22 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-10-16 18:08:51 +0200
commit9f934223b2051bd5aa5c97fa0bf9eb777a711e90 (patch)
tree1d902c1437a2e7e0d5d3364633c96340f1c40acc /src/basic/prioq.c
parentutil: fix segfault in prioq_remove() with empty Prioq object (diff)
downloadsystemd-9f934223b2051bd5aa5c97fa0bf9eb777a711e90.tar.xz
systemd-9f934223b2051bd5aa5c97fa0bf9eb777a711e90.zip
prioq: add one more assertion
Diffstat (limited to '')
-rw-r--r--src/basic/prioq.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/prioq.c b/src/basic/prioq.c
index e816b2c62a..1e4d8d1b2f 100644
--- a/src/basic/prioq.c
+++ b/src/basic/prioq.c
@@ -88,6 +88,7 @@ static void swap(Prioq *q, unsigned j, unsigned k) {
static unsigned shuffle_up(Prioq *q, unsigned idx) {
assert(q);
+ assert(idx < q->n_items);
while (idx > 0) {
unsigned k;