From: Radosław Korzeniewski Date: Thu, 24 Dec 2020 11:32:34 +0000 (+0100) Subject: alist: Fix for memory overflow access. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ce0d3ff70d34dd05bb303d3d696f31c1785960c;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];