Skip to content

hello_xr reads off the end of XrExtensionProperties array #578

@AndrewSumsion

Description

@AndrewSumsion

In hello_xr at openxr_program.cpp:208, the application attempts to log the extensionName of a non-existent XrExtensionProperties, resulting in logging uninitialized data from the heap. It searches through the array of XrExtensionProperties, and if it doesn't find XR_KHR_composition_layer_depth, then the iterator is left at extensionProperties.end(), which does not point to a valid instance, but the code reads from it nonetheless.

if (depthExtensionProperties != extensionProperties.end()) {
    Log::Write(Log::Level::Info, Fmt("Depth submission supported (%s)", depthExtensionProperties->extensionName));
    extensions.push_back(depthExtensionProperties->extensionName);
    m_supportsDepthLayer = true;
} else {
    Log::Write(Log::Level::Info, Fmt("Depth submission NOT supported (%s)", depthExtensionProperties->extensionName)); // <-- issue here
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions