Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
tracker-priority-queue: Check segments array bounds in peek function
Browse files Browse the repository at this point in the history
Failing to do this will cause indexing outside the bounds of the array
when the priority queue is empty.
  • Loading branch information
jonte committed Sep 12, 2013
1 parent 1c2d3eb commit 2a98cb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libtracker-miner/tracker-priority-queue.c
Expand Up @@ -316,7 +316,7 @@ tracker_priority_queue_peek (TrackerPriorityQueue *queue,
{
g_return_val_if_fail (queue != NULL, NULL);

if (priority_out) {
if (priority_out && queue->segments->len > 0) {
PrioritySegment *segment;

segment = &g_array_index (queue->segments, PrioritySegment, 0);
Expand Down

0 comments on commit 2a98cb9

Please sign in to comment.