summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-11-06 00:30:29 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-11-06 00:30:29 +0100
commit95b015de3849d8d8d03d9441ae1682a04c38833b (patch)
tree421cd372dae5ac539327bbacd963ca7548357a96
parent82de16f92ca5259e9ddb4f328f086cb6a9f043b0 (diff)
hostnamed: prevent it from crashing if the chassis is unknown
When fallback_chassis would return null it led to a crash and an empty result in hostnamectl. Only seen after the sd-port.
-rw-r--r--src/hostname/hostnamed.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index 0854bc412f..ece5d1d410 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -360,6 +360,9 @@ static int property_get_chassis(
else
name = c->data[PROP_CHASSIS];
+ if(!name)
+ name = "";
+
r = sd_bus_message_append(reply, "s", name);
if (r < 0)
return r;