Skip to content

Fix segfault on regex deinitialization#504

Open
nvlled wants to merge 1 commit intojordansissel:masterfrom
nvlled:fix-segfault-and-refactor
Open

Fix segfault on regex deinitialization#504
nvlled wants to merge 1 commit intojordansissel:masterfrom
nvlled:fix-segfault-and-refactor

Conversation

@nvlled
Copy link

@nvlled nvlled commented Feb 4, 2026

This fixes a segfault error when xdotool is given a broken regex string:

$ xdotool search '*'
Defaulting to search window name, class, classname, and role
Failed to compile regex (return code 13): '*'
Segmentation fault (core dumped)

Some changes are also made so that regexes are compiled only once during initialization. This reduces some overhead when searching through each window entry.

This fixes a segfault error when xdotool is given
a broken regex string:

  $ xdotool search '*'
  Defaulting to search window name, class, classname, and role
  Failed to compile regex (return code 13): '*'
  Segmentation fault (core dumped)

Some changes are also made so that regexes are compiled
only once during initialization. This reduces some overhead
when searching through each window entry.
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