Commit a98f70ac authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] address valgrind warnings

4059.	[bug]		Addressed valgrind warnings. [RT #38549]
parent 2616cb69
4059. [bug] Addressed valgrind warnings. [RT #38549]
4058. [bug] UDP dispatches could use the wrong psuedorandom 4058. [bug] UDP dispatches could use the wrong psuedorandom
number generator context. [RT #38578] number generator context. [RT #38578]
......
...@@ -1053,7 +1053,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, ...@@ -1053,7 +1053,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen,
if (le->dscp != -1 && ifp->dscp == -1) if (le->dscp != -1 && ifp->dscp == -1)
ifp->dscp = le->dscp; ifp->dscp = le->dscp;
else if (le->dscp != ifp->dscp) { else if (le->dscp != ifp->dscp) {
isc_sockaddr_format(&listen_addr, isc_sockaddr_format(&listen_sockaddr,
sabuf, sabuf,
sizeof(sabuf)); sizeof(sabuf));
isc_log_write(IFMGR_COMMON_LOGARGS, isc_log_write(IFMGR_COMMON_LOGARGS,
......
...@@ -9858,7 +9858,7 @@ ns_server_signing(ns_server_t *server, char *args, isc_buffer_t **text) { ...@@ -9858,7 +9858,7 @@ ns_server_signing(ns_server_t *server, char *args, isc_buffer_t **text) {
isc_boolean_t chain = ISC_FALSE; isc_boolean_t chain = ISC_FALSE;
isc_boolean_t setserial = ISC_FALSE; isc_boolean_t setserial = ISC_FALSE;
isc_uint32_t serial = 0; isc_uint32_t serial = 0;
char keystr[DNS_SECALG_FORMATSIZE + 7]; char keystr[DNS_SECALG_FORMATSIZE + 7]; /* <5-digit keyid>/<alg> */
unsigned short hash = 0, flags = 0, iter = 0, saltlen = 0; unsigned short hash = 0, flags = 0, iter = 0, saltlen = 0;
unsigned char salt[255]; unsigned char salt[255];
const char *ptr; const char *ptr;
...@@ -9884,7 +9884,7 @@ ns_server_signing(ns_server_t *server, char *args, isc_buffer_t **text) { ...@@ -9884,7 +9884,7 @@ ns_server_signing(ns_server_t *server, char *args, isc_buffer_t **text) {
ptr = next_token(&args, " \t"); ptr = next_token(&args, " \t");
if (ptr == NULL) if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND); return (ISC_R_UNEXPECTEDEND);
memmove(keystr, ptr, sizeof(keystr)); strlcpy(keystr, ptr, sizeof(keystr));
} else if (strcasecmp(ptr, "-nsec3param") == 0) { } else if (strcasecmp(ptr, "-nsec3param") == 0) {
const char *hashstr, *flagstr, *iterstr; const char *hashstr, *flagstr, *iterstr;
char nbuf[512]; char nbuf[512];
......
...@@ -688,7 +688,7 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) { ...@@ -688,7 +688,7 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
name = dns_fixedname_name(&fn); name = dns_fixedname_name(&fn);
dns_rbt_fullnamefromnode(node, name); dns_rbt_fullnamefromnode(node, name);
isc_buffer_init(&b, nbuf, sizeof(nbuf) - 1); isc_buffer_init(&b, nbuf, sizeof(nbuf));
result = dns_name_totext(name, ISC_FALSE, &b); result = dns_name_totext(name, ISC_FALSE, &b);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto skip; goto skip;
...@@ -699,6 +699,9 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) { ...@@ -699,6 +699,9 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
isc_buffer_init(&b, tbuf, sizeof(tbuf)); isc_buffer_init(&b, tbuf, sizeof(tbuf));
dns_time32_totext(n->expiry, &b); dns_time32_totext(n->expiry, &b);
/* Zero terminate. */
isc_buffer_putuint8(&b, 0);
fprintf(fp, "%s %s %s\n", nbuf, fprintf(fp, "%s %s %s\n", nbuf,
n->forced ? "forced" : "regular", n->forced ? "forced" : "regular",
tbuf); tbuf);
......
...@@ -519,6 +519,8 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) { ...@@ -519,6 +519,8 @@ cmsgsend(int s, int level, int type, struct addrinfo *res) {
return (ISC_FALSE); return (ISC_FALSE);
} }
memset(&control, 0, sizeof(control));
iovec.iov_base = buf; iovec.iov_base = buf;
iovec.iov_len = sizeof(buf); iovec.iov_len = sizeof(buf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment