]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't send uninitialized data in command replies
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 31 Jul 2013 13:02:09 +0000 (15:02 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 7 Aug 2013 12:46:16 +0000 (14:46 +0200)
The RPY_SUBNETS_ACCESSED and RPY_CLIENT_ACCESSES command replies can
contain uninitalized data from stack when the client logging is disabled
or a bad subnet is requested. These commands were never used by chronyc
and they require the client to be authenticated since version 1.25.

cmdmon.c

index e4f734918d3922221e73cf7688e6d1efae30d48f..6d6e32b0b0b7139e0bf0bdf722957e1983861181 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -1513,9 +1513,11 @@ handle_subnets_accessed(CMD_Request *rx_message, CMD_Reply *tx_message)
         break;
       case CLG_BADSUBNET:
         tx_message->status = htons(STT_BADSUBNET);
+        tx_message->data.subnets_accessed.n_subnets = htonl(0);
         return;
       case CLG_INACTIVE:
         tx_message->status = htons(STT_INACTIVE);
+        tx_message->data.subnets_accessed.n_subnets = htonl(0);
         return;
       default:
         assert(0);
@@ -1569,6 +1571,7 @@ handle_client_accesses(CMD_Request *rx_message, CMD_Reply *tx_message)
         break;
       case CLG_INACTIVE:
         tx_message->status = htons(STT_INACTIVE);
+        tx_message->data.client_accesses.n_clients = htonl(0);
         return;
       default:
         assert(0);