mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 04:55:08 -05:00
Don't send uninitialized data in command replies
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.
This commit is contained in:
3
cmdmon.c
3
cmdmon.c
@@ -1513,9 +1513,11 @@ handle_subnets_accessed(CMD_Request *rx_message, CMD_Reply *tx_message)
|
|||||||
break;
|
break;
|
||||||
case CLG_BADSUBNET:
|
case CLG_BADSUBNET:
|
||||||
tx_message->status = htons(STT_BADSUBNET);
|
tx_message->status = htons(STT_BADSUBNET);
|
||||||
|
tx_message->data.subnets_accessed.n_subnets = htonl(0);
|
||||||
return;
|
return;
|
||||||
case CLG_INACTIVE:
|
case CLG_INACTIVE:
|
||||||
tx_message->status = htons(STT_INACTIVE);
|
tx_message->status = htons(STT_INACTIVE);
|
||||||
|
tx_message->data.subnets_accessed.n_subnets = htonl(0);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
@@ -1569,6 +1571,7 @@ handle_client_accesses(CMD_Request *rx_message, CMD_Reply *tx_message)
|
|||||||
break;
|
break;
|
||||||
case CLG_INACTIVE:
|
case CLG_INACTIVE:
|
||||||
tx_message->status = htons(STT_INACTIVE);
|
tx_message->status = htons(STT_INACTIVE);
|
||||||
|
tx_message->data.client_accesses.n_clients = htonl(0);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user