On Wed Jul 3 14:23:23 2024 +0000, Grigory Vasilyev wrote:
Can we get an incorrect pointer in desktop_shm, for example NULL, which will lead to null pointer dereference? It's probably better to move to ELSE after checking the status.
ret = status ? FALSE : !!(desktop_shm->flags & DF_WINE_VIRTUAL_DESKTOP);
No, desktop_shm will always be a valid pointer, although it has to be used within the loop and only within it. This is how the shared memory objects have to be accessed to make sure the data we read is valid.