Skip to content

(master) xf86Wacom: fix unchecked allocations that NULL-deref on OOM - #19

Open
metux wants to merge 1 commit into
masterfrom
pr/master-xf86wacom-fix-unchecked-allocations-that-null-deref-on-oom-_2026-07-07_13-37-24
Open

(master) xf86Wacom: fix unchecked allocations that NULL-deref on OOM#19
metux wants to merge 1 commit into
masterfrom
pr/master-xf86wacom-fix-unchecked-allocations-that-null-deref-on-oom-_2026-07-07_13-37-24

Conversation

@metux

@metux metux commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

wcmLog() derefs its calloc() result (via vsnprintf) with no NULL
check -- skip logging instead of writing through NULL on allocation
failure.

wcmTimerNew()/wcmTimerFree()/wcmTimerCancel()/wcmTimerSet() all
operate on a WacomTimerPtr without checking it for NULL first.
wcmTimerNew() itself derefs its own calloc() result unconditionally,
and since callers (wcmConfig.c, up to 3 per new device during
PreInit/hotplug) don't check its return value either, a failed
allocation there reaches the other three as a NULL WacomTimerPtr.
Make all four tolerate NULL, matching the same pattern already used
by the underlying xserver TimerCancel()/TimerFree().

Signed-off-by: Enrico Weigelt, metux IT consult info@metux.net

wcmLog() derefs its calloc() result (via vsnprintf) with no NULL
check -- skip logging instead of writing through NULL on allocation
failure.

wcmTimerNew()/wcmTimerFree()/wcmTimerCancel()/wcmTimerSet() all
operate on a WacomTimerPtr without checking it for NULL first.
wcmTimerNew() itself derefs its own calloc() result unconditionally,
and since callers (wcmConfig.c, up to 3 per new device during
PreInit/hotplug) don't check its return value either, a failed
allocation there reaches the other three as a NULL WacomTimerPtr.
Make all four tolerate NULL, matching the same pattern already used
by the underlying xserver TimerCancel()/TimerFree().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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