]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
alist: Fix for memory overflow access.
authorRadosław Korzeniewski <radekk@inteos.pl>
Thu, 24 Dec 2020 11:32:34 +0000 (12:32 +0100)
committerEric Bollengier <eric@baculasystems.com>
Wed, 20 Jan 2021 12:15:44 +0000 (13:15 +0100)
bacula/src/lib/alist.c

index 30914152cad7aa60155adbe8b63aca24fcbc9c42..81f60aba7ccab4bd068fd62ab3b7d20d0e4eed4b 100644 (file)
@@ -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];