From: Radosław Korzeniewski Date: Thu, 24 Dec 2020 11:32:34 +0000 (+0100) Subject: alist: Fix for memory overflow access. X-Git-Tag: Release-11.3.2~968 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56c6d89a1836a5e725c93184e788fadd84d41fe0;p=thirdparty%2Fbacula.git alist: Fix for memory overflow access. --- 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];