kondrak / vkQuake2

id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, macOS, FreeBSD, Raspberry Pi 4)
GNU General Public License v2.0
899 stars 89 forks source link

Pointer to local variable that goes out of scope #22

Closed sawickiap closed 5 years ago

sawickiap commented 5 years ago

https://github.com/kondrak/vkQuake2/blob/26ac266cb154e5250cea86ffd4e77c1786b53e60/ref_vk/vk_buffer.c#L59

You store a pointer to a local array that immediately goes out of scope, so formally there is no guarantee that its pointer or contents will be valid when it's later used.

kondrak commented 5 years ago

Good catch, thanks!