From: Frantisek Sumsal Date: Mon, 31 Jul 2023 14:29:39 +0000 (+0200) Subject: resolvectl: initialize the server state X-Git-Tag: v255-rc1~866 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=f7e5f39d617097886346b2b75b480486553f8471;p=systemd%2F.git resolvectl: initialize the server state Since not all fields of the dispatch table are mandatory we might end up reading garbage if the optional field is not set. In CIs we were lucky enough (or probably unfortunate enough) that the garbage was printable, but in other cases the `show-server-state` verb would just fail with: $ resolvectl show-server-state Failed to print table: Invalid argument Follow-up to bc837621a38. --- diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 35c649096e..8112043353 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -3023,7 +3023,7 @@ static int dump_server_state(JsonVariant *server) { bool packet_rrsig_missing; bool packet_invalid; bool packet_do_off; - } server_state; + } server_state = {}; int r;