Skip to content

Bug | Windows bool/BOOL pointer cast causes memory corruption in WebView2 getters` #223

@AnnaSasDev

Description

@AnnaSasDev

Severity

Critical (crash, data loss)

Describe the bug

bool* outputs are cast to BOOL* and passed to WebView2 APIs. BOOL is 4 bytes while C++ bool is 1 byte.

Steps to reproduce

  1. Call any getter path using:
  2. GetContextMenuEnabled, GetZoomEnabled, or GetDevToolsEnabled
  3. Observe undefined behavior risk from 4-byte writes into 1-byte storage.

Expected behavior

No memory overwrite; safe conversion from BOOL to bool.

Actual behavior

Potential stack/heap corruption.

Logs / Error Output

Minimal reproduction

src/InfiniFrame.Native/Platform/Windows/Window.cpp:614
src/InfiniFrame.Native/Platform/Windows/Window.cpp:624
src/InfiniFrame.Native/Platform/Windows/Window.cpp:634

.NET Version

No response

Project Version / Commit

No response

Operating System

No response

Checklist

  • I searched existing issues
  • I can reproduce this consistently
  • I included logs and/or a reproduction

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions