Skip to content

Add null guard in CreateInputFilter#19

Merged
willwade merged 1 commit into
mainfrom
fix/null-guard-inputfilter
Jun 18, 2026
Merged

Add null guard in CreateInputFilter#19
willwade merged 1 commit into
mainfrom
fix/null-guard-inputfilter

Conversation

@willwade

Copy link
Copy Markdown

If Realize() partially fails (e.g. ChangeAlphabet throws and the exception is caught by an outer handler), CreateModules() may never have run, leaving the module registry empty. When SetStringParameter is then called for SP_INPUT_FILTER (e.g. the CAPI forces 'Normal Control' after Realize), CreateInputFilter dereferences a null pointer and crashes.

Add an explicit null check after both lookup attempts — if no input filter module is found, return early rather than crashing.

If Realize() partially fails (e.g. ChangeAlphabet throws and the
exception is caught by an outer handler), CreateModules() may never
have run, leaving the module registry empty. When SetStringParameter
is then called for SP_INPUT_FILTER (e.g. the CAPI forces 'Normal
Control' after Realize), CreateInputFilter dereferences a null
pointer and crashes.

Add an explicit null check after both lookup attempts — if no input
filter module is found, return early rather than crashing.

Signed-off-by: will wade <willwade@gmail.com>
@willwade willwade merged commit 5533eb9 into main Jun 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant