From 5ce0d3ff70d34dd05bb303d3d696f31c1785960c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rados=C5=82aw=20Korzeniewski?= Date: Thu, 24 Dec 2020 12:32:34 +0100 Subject: [PATCH] alist: Fix for memory overflow access. --- bacula/src/lib/alist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bacula/src/lib/alist.c b/bacula/src/lib/alist.c index 30914152c..81f60aba7 100644 --- a/bacula/src/lib/alist.c +++ b/bacula/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]; -- 2.47.3