Skip to content

Initialize *ppv in comhost DllGetClassObject#128916

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dllgetclassobject-initialization
Open

Initialize *ppv in comhost DllGetClassObject#128916
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-dllgetclassobject-initialization

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 2, 2026

DllGetClassObject in src/native/corehost/comhost/comhost.cpp had failure paths (CLSID not in map, get_com_delegate failure) that returned a failure HRESULT without writing to *ppv, violating the COM contract that out parameters must always be initialized.

Null it out on function entry.

Copilot AI self-assigned this Jun 2, 2026
Copilot AI review requested due to automatic review settings June 2, 2026 18:32
Copilot AI review requested due to automatic review settings June 2, 2026 18:32
Copilot AI linked an issue Jun 2, 2026 that may be closed by this pull request
Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 2, 2026 18:37
Copilot AI changed the title [WIP] Fix DllGetClassObject to initialize out parameter Initialize *ppv in comhost DllGetClassObject Jun 2, 2026
Copilot AI requested a review from elinor-fung June 2, 2026 18:37
@elinor-fung elinor-fung marked this pull request as ready for review June 2, 2026 20:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the comhost COM entrypoint DllGetClassObject to ensure its ppv out-parameter is initialized on all exit paths, by validating ppv and setting *ppv = nullptr at function entry.

Changes:

  • Add an early ppv == nullptr guard returning E_POINTER.
  • Initialize *ppv to nullptr before any failure-return paths are possible.
Show a summary per file
File Description
src/native/corehost/comhost/comhost.cpp Ensures DllGetClassObject initializes the COM out parameter (*ppv) even when returning failure HRESULTs.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment thread src/native/corehost/comhost/comhost.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

DllGetClassObject does not reliably initialize its out pararameter

4 participants