]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolvectl: initialize the server state
authorFrantisek Sumsal <frantisek@sumsal.cz>
Mon, 31 Jul 2023 14:29:39 +0000 (16:29 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 17:31:20 +0000 (02:31 +0900)
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.

src/resolve/resolvectl.c

index 35c649096e29f9d52e46ca836bcfa39b986f7a87..811204335373af6e221a4fc5f5cd510c9f9ca4ec 100644 (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;