Skip to content

Commit

Permalink
Off-by-one error in pool consistency check
Browse files Browse the repository at this point in the history
I'm getting a segmentation fault on this line because pool->objects can be NULL. I suspect this > should be >=, though I'm not quite sure.

Signed-off-by: Eric Mertens <emertens@gmail.com>
  • Loading branch information
glguy authored and simo5 committed Jul 22, 2024
1 parent b0e23ce commit fe03d43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static void obj_rm_from_pool(P11PROV_OBJ *obj)
}

/* LOCKED SECTION ------------- */
if (obj->poolid > pool->size || pool->objects[obj->poolid] != obj) {
if (obj->poolid >= pool->size || pool->objects[obj->poolid] != obj) {
ret = CKR_GENERAL_ERROR;
P11PROV_raise(pool->provctx, ret, "Objects pool in inconsistent state");
goto done;
Expand Down

0 comments on commit fe03d43

Please sign in to comment.