Skip to content

Commit a6f2eee

Browse files
author
Alexander Korotkov
committed
Fix collector out of array access.
1 parent 91305b2 commit a6f2eee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

collector.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ get_next_observation(History *observations)
122122
{
123123
HistoryItem *result;
124124

125-
result = &observations->items[observations->index];
126-
observations->index++;
127125
if (observations->index >= observations->count)
128126
{
129127
observations->index = 0;
130128
observations->wraparound = true;
131129
}
130+
result = &observations->items[observations->index];
131+
observations->index++;
132132
return result;
133133
}
134134

0 commit comments

Comments
 (0)