From 4d339f05afac327faa07b77ab5d2415018b66b15 Mon Sep 17 00:00:00 2001 From: Caleb Harper <28740091+Mrcarrot1@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:50:13 -0600 Subject: [PATCH] Fix segmentation fault in WirePlumber module The WirePlumber module assumes that either the node's name or description will not be null. This leads to a segmentation fault when both are. The solution provided is to set self->node_name_ to a default value in this case. --- src/modules/wireplumber.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/wireplumber.cpp b/src/modules/wireplumber.cpp index b2d9b39d..a020e2a0 100644 --- a/src/modules/wireplumber.cpp +++ b/src/modules/wireplumber.cpp @@ -81,7 +81,7 @@ void waybar::modules::Wireplumber::updateNodeName(waybar::modules::Wireplumber* auto nick = wp_properties_get(properties, "node.nick"); auto description = wp_properties_get(properties, "node.description"); - self->node_name_ = nick ? nick : description; + self->node_name_ = nick ? nick : description ? description : "Unknown node name"; spdlog::debug("[{}]: Updating node name to: {}", self->name_, self->node_name_); }