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

Bug: IStream_Vtbl's Seek wrapper can dereference null pointer #2122

Closed
miolad opened this issue Oct 25, 2022 · 3 comments · Fixed by #2241
Closed

Bug: IStream_Vtbl's Seek wrapper can dereference null pointer #2122

miolad opened this issue Oct 25, 2022 · 3 comments · Fixed by #2241
Labels
bug Something isn't working

Comments

@miolad
Copy link

miolad commented Oct 25, 2022

The implementation of the wrapper of IStream::Seek doesn't check whether plibNewPosition is NULL before writing to it, even though the docs state that NULL is indeed a valid value for that parameter.

::core::ptr::write(plibnewposition, ::core::mem::transmute(ok__));

@kennykerr kennykerr added the bug Something isn't working label Oct 25, 2022
@kennykerr
Copy link
Collaborator

Implementation support still needs some work. You can use the interface macro as a workaround in the meantime.

@kennykerr
Copy link
Collaborator

Tracked this down and it's rooted in a Win32 metadata bug: microsoft/win32metadata#1005

The challenge is that this parameter is a trailing optional parameter and many such parameters are incorrectly marked as optional in metadata. Anyway, I've got a fix for this issue and hopefully the metadata will be improved shortly.

@kennykerr
Copy link
Collaborator

This line:

if flags.input() || !flags.output() || param.kind.is_array() {

Needs to include optional parameters as follows:

if flags.input() || !flags.output() || flags.optional() || param.kind.is_array() {

But that's blocked on: microsoft/win32metadata#1005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants