mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 10:45:06 -05:00
Fix errors detected by valgrind
I tried running chronyd in valgrind and the result was that there are four places where memory is not initialized. A patch fixing the errors is in the attachment.
This commit is contained in:
committed by
Richard P. Curnow
parent
bc0aaa9217
commit
8336f14680
4
cmdmon.c
4
cmdmon.c
@@ -166,7 +166,7 @@ CAM_Initialise(void)
|
||||
int port_number;
|
||||
struct sockaddr_in my_addr;
|
||||
unsigned long bind_address;
|
||||
int on_off;
|
||||
int on_off = 1;
|
||||
|
||||
if (initialised) {
|
||||
CROAK("Shouldn't be initialised");
|
||||
@@ -1631,11 +1631,13 @@ read_from_cmd_socket(void *anything)
|
||||
tx_message.reply = htons(RPY_NULL);
|
||||
tx_message.number = htons(1);
|
||||
tx_message.total = htons(1);
|
||||
tx_message.pad1 = 0;
|
||||
tx_message.utoken = htonl(utoken);
|
||||
/* Set this to a default (invalid) value. This protects against the
|
||||
token field being set to an arbitrary value if we reject the
|
||||
message, e.g. due to the host failing the access check. */
|
||||
tx_message.token = htonl(0xffffffffUL);
|
||||
memset(&tx_message.auth, 0, sizeof(tx_message.auth));
|
||||
|
||||
remote_ip = ntohl(where_from.sin_addr.s_addr);
|
||||
remote_port = ntohs(where_from.sin_port);
|
||||
|
||||
Reference in New Issue
Block a user