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

add null-check for empty arrays in debug trampoline #2490

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

Fuzzyzilla
Copy link
Contributor

  1. Update documentation to reflect any user-facing changes - in this repository.
    N/A

  2. Make sure that the changes are covered by unit-tests.
    Covered already in debug example binary.

  3. Run cargo clippy on the changes.
    None new, some exist already upstream.

  4. Run cargo +nightly fmt on the changes.

  5. Please put changelog entries in the description of this Pull Request
    if knowledge of this change could be valuable to users. No need to put the
    entries to the changelog directly, they will be transferred to the changelog
    file by maintainers right after the Pull Request merge.

    Please remove any items from the template below that are not applicable.

  6. Describe in common words what is the purpose of this change, related
    Github Issues, and highlight important implementation aspects.

A simple check for null pointers in the debug callback. My current device (Mesa 24.0.2-arch1.1 on device Intel(R) HD Graphics 2500 (IVB GT1)) reports a null pointer with count of zero for empty arrays - this is allowable under the vulkan spec for VkDebugUtilsMessengerCallbackDataEXT but is invalid for use in slice::from_raw_parts which needs a well-aligned non-null pointer part even for zero length slices.

Changelog:

### Bugs fixed
Fix UB in debug messenger when driver reports null pointers for empty arrays.

@marc0246
Copy link
Contributor

marc0246 commented Mar 6, 2024

Gracias mi amiga.

@marc0246 marc0246 merged commit 12c3c9d into vulkano-rs:master Mar 6, 2024
5 checks passed
marc0246 added a commit that referenced this pull request Mar 6, 2024
HadrienG2 pushed a commit to HadrienG2/vulkano that referenced this pull request Jul 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants