Coverity Scan issues related to "delv +ns" et al.
With !7477 (merged) merged, there were a few Coverity Scan issues reported:
*** CID 451100: Control flow issues (DEADCODE)
/bin/delv/delv.c: 2090 in sendquery()
2084 message, &request));
2085 return;
2086
2087 cleanup:
2088 if (message != NULL) {
2089 if (mname != NULL) {
>>> CID 451100: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "dns_message_puttempname(mes...".
2090 dns_message_puttempname(message, &mname);
2091 }
2092 if (mrdataset != NULL) {
2093 dns_message_puttemprdataset(message, &mrdataset);
2094 }
2095 dns_message_detach(&message);
*** CID 451098: Control flow issues (DEADCODE)
/bin/delv/delv.c: 2093 in sendquery()
2087 cleanup:
2088 if (message != NULL) {
2089 if (mname != NULL) {
2090 dns_message_puttempname(message, &mname);
2091 }
2092 if (mrdataset != NULL) {
>>> CID 451098: Control flow issues (DEADCODE)
>>> Execution cannot reach this statement: "dns_message_puttemprdataset...".
2093 dns_message_puttemprdataset(message, &mrdataset);
2094 }
2095 dns_message_detach(&message);
2096 }
2097
2098 shutdown_server();
*** CID 451097: Error handling issues (CHECKED_RETURN)
/bin/delv/delv.c: 2124 in run_server()
2118 dns_cache_t *cache = NULL;
2119 isc_sockaddr_t addr, any;
2120 struct in_addr in;
2121
2122 UNUSED(arg);
2123
>>> CID 451097: Error handling issues (CHECKED_RETURN)
>>> Calling "inet_pton" without checking return value (as is done elsewhere 32 out of 33 times).
2124 inet_pton(AF_INET, "127.0.0.1", &in);
2125 isc_sockaddr_fromin(&addr, &in, 0);
2126
2127 CHECK(ns_server_create(mctx, matchview, &sctx));
2128
2129 CHECK(dns_dispatchmgr_create(mctx, netmgr, &dispatchmgr));
*** CID 451095: (TAINTED_SCALAR)
/lib/ns/client.c: 1911 in ns_client_request()
1905 NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
1906 "message parsing failed: %s",
1907 isc_result_totext(result));
1908 if (result == ISC_R_NOSPACE || result == DNS_R_BADTSIG) {
1909 result = DNS_R_FORMERR;
1910 }
>>> CID 451095: (TAINTED_SCALAR)
>>> Passing tainted expression "client->message" to "ns_client_error", which uses it as an offset.
1911 ns_client_error(client, result);
1912 return;
1913 }
1914
1915 dns_opcodestats_increment(client->manager->sctx->opcodestats,
1916 client->message->opcode);
/lib/ns/client.c: 1911 in ns_client_request()
1905 NS_LOGMODULE_CLIENT, ISC_LOG_DEBUG(1),
1906 "message parsing failed: %s",
1907 isc_result_totext(result));
1908 if (result == ISC_R_NOSPACE || result == DNS_R_BADTSIG) {
1909 result = DNS_R_FORMERR;
1910 }
>>> CID 451095: (TAINTED_SCALAR)
>>> Passing tainted expression "client->message" to "ns_client_error", which uses it as a loop boundary.
1911 ns_client_error(client, result);
1912 return;
1913 }
1914
1915 dns_opcodestats_increment(client->manager->sctx->opcodestats,
1916 client->message->opcode);