Nothing in this code guarantees that threadedStorage will actually be valid, since the code doesn't check if the object still remains in the global object table, and there's also no ref added to the object when it's in a property table like this.
This means that a UAF may occur in this code, as seen in the updated gone.phpt here: 355432f7229afd64e9c16db666532c5b2cb3fe60
This is a pain to fix. In any thread which isn't the owner of the object, this will necessitate a pthreads_globals_lock() to verify that the object in question is still valid.
https://github.com/pmmp/pthreads/blob/355432f7229afd64e9c16db666532c5b2cb3fe60/src/store.c#L80
Nothing in this code guarantees that
threadedStorage
will actually be valid, since the code doesn't check if the object still remains in the global object table, and there's also no ref added to the object when it's in a property table like this.This means that a UAF may occur in this code, as seen in the updated gone.phpt here: 355432f7229afd64e9c16db666532c5b2cb3fe60