Description: alist: Fix for memory overflow access.
Author: Radosław Korzeniewski <radekk@inteos.pl>
Last-Update: 2020-12-24
Forwarded: not-needed

Upstream commit 5ce0d3ff70d34dd05bb303d3d696f31c1785960c

diff --git a/src/lib/alist.c b/src/lib/alist.c
index 30914152c..81f60aba7 100644
--- a/src/lib/alist.c
+++ b/src/lib/alist.c
@@ -183,7 +183,7 @@ void * baselist::remove_item(int index)
 /* Get the index item -- we should probably allow real indexing here */
 void * baselist::get(int index)
 {
-   if (items == NULL || index < 0 || index > last_item) {
+   if (items == NULL || index < 0 || index >= last_item) {
       return NULL;
    }
    return items[index];
