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 bc837621a3.
This commit is contained in:
Frantisek Sumsal 2023-07-31 16:29:39 +02:00 committed by Yu Watanabe
parent 279b5d4a8c
commit f7e5f39d61

View file

@ -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;