20 Feb
2024
20 Feb
'24
1:11 p.m.
Jinoh Kang (@iamahuman) commented about server/mapping.c:
+ shared->obj.destroyed = 0; + } + SHARED_WRITE_END; + return i; + } + } + + if (session.object_count == session.object_capacity && grow_session_mapping()) return -1; + return session.object_count++; +} + +void free_shared_object( int index ) +{ + const session_obj_t *object = &session.shared->objects[index]; + + if (index < 0) return; Undefined behavior due to out-of-bounds pointer generation.
```suggestion:-2+0 const session_obj_t *object; if (index < 0) return; object = &session.shared->objects[index]; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3103#note_62039