File 0022-Make-sure-node-index-is-smaller-than-number-of-objects.patch of Package libplist.4090

From 2c44cd6e7d3b961dd237b74a24cbaa80b3efc7a9 Mon Sep 17 00:00:00 2001
From: Nikias Bassen <nikias@gmx.li>
Date: Sun, 5 Feb 2017 01:59:30 +0100
Subject: [PATCH] bplist: Make sure node index is smaller than number of
 objects

---
 src/bplist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bplist.c b/src/bplist.c
index d2a1ccb..d83f700 100644
--- a/src/bplist.c
+++ b/src/bplist.c
@@ -630,7 +630,7 @@ static plist_t parse_bin_node_at_index(struct bplist_data *bplist, uint32_t node
     plist_t plist = NULL;
     const char* idx_ptr = NULL;
 
-    if (node_index > bplist->num_objects)
+    if (node_index >= bplist->num_objects)
         return NULL;
 
     idx_ptr = bplist->offset_table + node_index * bplist->offset_size;
openSUSE Build Service is sponsored by