Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Proper bounds check on heap index and queue size.

  • Loading branch information...
commit 6cfe499d760f41f7020e9581a8cf667e8aad2901 1 parent 84cfd9c
@kr authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  pq.c
View
2  pq.c
@@ -160,7 +160,7 @@ pq_remove(pq q, job j)
unsigned long long int id;
unsigned int pri;
- if (q->used == 0) return NULL;
+ if (j->heap_index >= q->used) return NULL;
if (q->heap[j->heap_index] != j) return NULL;
id = j->id;
Please sign in to comment.
Something went wrong with that request. Please try again.