From 95b015de3849d8d8d03d9441ae1682a04c38833b Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Wed, 6 Nov 2013 00:30:29 +0100 Subject: [PATCH] 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. --- src/hostname/hostnamed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 0854bc412..ece5d1d41 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; -- 2.30.2