Skip to content

wcm: print an error and exit on empty <value> elements in metadata - #128

Merged
soreau merged 1 commit into
WayfireWM:masterfrom
bornmw:metadata-empty-value-error
Oct 11, 2026
Merged

soreau merged 1 commit into
WayfireWM:masterfrom
bornmw:metadata-empty-value-error

Conversation

@bornmw

@bornmw bornmw commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #126, implementing the handling discussed there: print an error and exit instead of segfaulting.

The option desc parser dereferenced n->children->content for <value> and <_name> elements without a null check, so an empty <value></value> element segfaulted wcm at startup. The guard now prints an error naming the plugin and the option, and exits cleanly. The is_value/is_name computation is done once before the type branches (identical in both).

Verified with a minimal metadata file containing an empty <value> (run with XDG_DATA_HOME pointed at a test metadata dir):

  • stock: deterministic SIGSEGV (exit 139)
  • this branch: ERROR: [badplugin] empty <value> element in option 'test_opt' description; fix the plugin metadata, clean exit(1)
  • valid metadata (string and int options with value/_name pairs) loads and runs as before

@soreau

soreau commented Oct 10, 2026

Copy link
Copy Markdown
Member

To pass CI, click the three dots next to the failure and click 'View details', and there should be a patch there you can apply.

@bornmw
bornmw force-pushed the metadata-empty-value-error branch from 5978cb5 to 4f463fa Compare October 10, 2026 17:03
The option desc parser dereferenced n->children->content for <value>
and <_name> elements without a null check. An empty <value></value>
element (no children) segfaulted wcm at startup.

Following the handling accepted in WayfireWM#126: print an error naming the
plugin and option, and exit cleanly. The same is_value/is_name
computation is now done once before the type branches.
@soreau

soreau commented Oct 11, 2026

Copy link
Copy Markdown
Member

Thanks!

@soreau
soreau merged commit 872077c into WayfireWM:master Oct 11, 2026
2 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.

2 participants