Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized pNext Pointer #247

Closed
andrew-lunarg opened this issue Nov 18, 2022 · 1 comment
Closed

Uninitialized pNext Pointer #247

andrew-lunarg opened this issue Nov 18, 2022 · 1 comment

Comments

@andrew-lunarg
Copy link

        VkDeviceGroupDeviceCreateInfo device_group_create_info;
	VkPhysicalDeviceGroupProperties device_group_info; // <------- Struct is not zeroed.

	if(num_device_groups > 0) {
		// we always use the first group
		num_device_groups = 1;
		_VK(vkEnumeratePhysicalDeviceGroups(qvk.instance, &num_device_groups, &device_group_info)); // <---- Whether pNext is zero is undefined. It might often accidentally be so.

src/refresh/vkpt/main.c

In the example above, VkPhysicalDeviceGroupProperties device_group_info {}; would zero out the pNext pointer.

The sType is also not set in this example.

Might be worth doing a sweep of the code for similar cases.

Here is a Godbolt snippet showing struct members not being zeroed by default: https://godbolt.org/z/K8n7Wsj4h

@apanteleev
Copy link
Collaborator

Thanks for reporting the issue.

This has been fixed by #246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants