Skip to content

Bug | Null Function Pointer Call in Custom Scheme Handler #149

@AnnaSasDev

Description

@AnnaSasDev

Severity

Critical (crash, data loss)

Describe the bug

Location: src/InfiniFrame.Native/Platform/Linux/Window.cpp:100-106, :286-289, src/InfiniFrame.Native/Platform/Mac/UrlSchemeHandler.mm:12.
Custom-scheme handlers call callback pointers without null checks on Linux and macOS. If a scheme is registered but CustomSchemeHandler is null, request handling dereferences a null function pointer and crashes.

Steps to reproduce

  1. Provide at least one custom scheme name in init params.
  2. Leave CustomSchemeHandler null.
  3. Navigate to the custom scheme URL.

Expected behavior

Request is rejected safely (e.g., 404/error response) or registration is prevented when callback is null.

Actual behavior

Null function pointer call in scheme handler.

Logs / Error Output

Minimal reproduction

init.CustomSchemeNames[0] = (AutoString)"app";
init.CustomSchemeHandler = nullptr;
auto* w = InfiniFrame_ctor(&init);
InfiniFrame_NavigateToUrl(w, (AutoString)"app://test"); // crash path

.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