From b060852a7c5e8972a85129cb746f21f4aa5626d8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 17:41:30 +1100 Subject: [PATCH 01/74] signed vs unsigned fixes --- bin/dig/dig.c | 6 +++--- bin/dig/dighost.c | 8 ++++---- bin/dig/host.c | 2 +- bin/dig/include/dig/dig.h | 2 +- bin/dig/nslookup.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index ec923acdae..b53c44d414 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -233,7 +233,7 @@ help(void) { * Callback from dighost.c to print the received message. */ static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { isc_uint64_t diff; time_t tnow; struct tm tmnow; @@ -1311,11 +1311,11 @@ plus_option(const char *option, isc_boolean_t is_batchfile, result = parse_uint(&splitwidth, value, 1023, "split"); - if (splitwidth % 4 != 0) { + if ((splitwidth % 4) != 0U) { splitwidth = ((splitwidth + 3) / 4) * 4; fprintf(stderr, ";; Warning, split must be " "a multiple of 4; adjusting " - "to %d\n", splitwidth); + "to %u\n", splitwidth); } /* * There is an adjustment done in the diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index ac2db2a020..e02f301018 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -202,7 +202,7 @@ isc_result_t isc_boolean_t headers); void -(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query); +(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query); void (*dighost_trying)(char *frm, dig_lookup_t *lookup); @@ -266,7 +266,7 @@ hex_dump(isc_buffer_t *b) { isc_buffer_usedregion(b, &r); - printf("%d bytes\n", r.length); + printf("%u bytes\n", r.length); for (len = 0; len < r.length; len++) { printf("%02x ", r.base[len]); if (len % 16 == 15) { @@ -437,7 +437,7 @@ debug(const char *format, ...) { fflush(stdout); if (debugtiming) { TIME_NOW(&t); - fprintf(stderr, "%d.%06d: ", isc_time_seconds(&t), + fprintf(stderr, "%u.%06u: ", isc_time_seconds(&t), isc_time_nanoseconds(&t) / 1000); } va_start(args, format); @@ -3738,7 +3738,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { */ if (l->comments) printf(";; BADVERS, retrying with EDNS version %u.\n", - newedns); + (unsigned int)newedns); l->edns = newedns; n = requeue_lookup(l, ISC_TRUE); if (l->trace && l->trace_root) diff --git a/bin/dig/host.c b/bin/dig/host.c index 13800472e1..950f9a1e56 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -169,7 +169,7 @@ host_shutdown(void) { } static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { isc_time_t now; int diff; diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index 748a0a5ead..c132efd5d9 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -382,7 +382,7 @@ extern isc_result_t */ extern void -(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query); +(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query); /*%< * Print a message about where and when the response * was received from, like the final comment in the diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 131c9d6b4f..66232bf06a 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -387,7 +387,7 @@ detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers, } static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { UNUSED(bytes); UNUSED(from); @@ -549,7 +549,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) { printf(" %s\t\t%s\n", usesearch ? "search" : "nosearch", recurse ? "recurse" : "norecurse"); - printf(" timeout = %d\t\tretry = %d\tport = %d\tndots = %d\n", + printf(" timeout = %u\t\tretry = %d\tport = %u\tndots = %d\n", timeout, tries, port, ndots); printf(" querytype = %-8s\tclass = %s\n", deftype, defclass); printf(" srchlist = "); From ea8e149f4db76f8a80a788c3347730857e07617e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 17:51:05 +1100 Subject: [PATCH 02/74] use %u instead of %d --- bin/dnssec/dnssec-signzone.c | 20 ++++++++++---------- util/copyrights | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c index ea70f181dd..92025c1642 100644 --- a/bin/dnssec/dnssec-signzone.c +++ b/bin/dnssec/dnssec-signzone.c @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1999-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -2513,11 +2513,11 @@ loadzonekeys(isc_boolean_t preserve_keys, isc_boolean_t load_public) { goto cleanup; if (set_keyttl && keyttl != rdataset.ttl) { - fprintf(stderr, "User-specified TTL %d conflicts " + fprintf(stderr, "User-specified TTL %u conflicts " "with existing DNSKEY RRset TTL.\n", keyttl); fprintf(stderr, "Imported keys will use the RRSet " - "TTL %d instead.\n", + "TTL %u instead.\n", rdataset.ttl); } keyttl = rdataset.ttl; @@ -3128,12 +3128,12 @@ print_stats(isc_time_t *timer_start, isc_time_t *timer_finish, isc_uint64_t sig_ms; /* Signatures per millisecond */ FILE *out = output_stdout ? stderr : stdout; - fprintf(out, "Signatures generated: %10d\n", nsigned); - fprintf(out, "Signatures retained: %10d\n", nretained); - fprintf(out, "Signatures dropped: %10d\n", ndropped); - fprintf(out, "Signatures successfully verified: %10d\n", nverified); + fprintf(out, "Signatures generated: %10u\n", nsigned); + fprintf(out, "Signatures retained: %10u\n", nretained); + fprintf(out, "Signatures dropped: %10u\n", ndropped); + fprintf(out, "Signatures successfully verified: %10u\n", nverified); fprintf(out, "Signatures unsuccessfully " - "verified: %10d\n", nverifyfailed); + "verified: %10u\n", nverifyfailed); time_us = isc_time_microdiff(sign_finish, sign_start); time_ms = time_us / 1000; @@ -3646,8 +3646,8 @@ main(int argc, char *argv[]) { get_soa_ttls(); if (set_maxttl && set_keyttl && keyttl > maxttl) { - fprintf(stderr, "%s: warning: Specified key TTL %d " - "exceeds maximum zone TTL; reducing to %d\n", + fprintf(stderr, "%s: warning: Specified key TTL %u " + "exceeds maximum zone TTL; reducing to %u\n", program, keyttl, maxttl); keyttl = maxttl; } diff --git a/util/copyrights b/util/copyrights index eeeeeca713..9a0f62304f 100644 --- a/util/copyrights +++ b/util/copyrights @@ -133,7 +133,7 @@ ./bin/dnssec/dnssec-settime.docbook SGML 2009,2010,2011,2014,2015,2016,2017 ./bin/dnssec/dnssec-settime.html HTML DOCBOOK ./bin/dnssec/dnssec-signzone.8 MAN DOCBOOK -./bin/dnssec/dnssec-signzone.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./bin/dnssec/dnssec-signzone.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dnssec/dnssec-signzone.docbook SGML 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 ./bin/dnssec/dnssec-signzone.html HTML DOCBOOK ./bin/dnssec/dnssec-verify.8 MAN DOCBOOK From 89ff72bea0f2957ecbda6da5c59f6e108a423626 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 17:53:23 +1100 Subject: [PATCH 03/74] clear *logp --- bin/dnssec/dnssectool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index 3431ac8f85..f4b5e74a6c 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -209,12 +209,14 @@ cleanup_logging(isc_log_t **logp) { REQUIRE(logp != NULL); log = *logp; + *logp = NULL; + if (log == NULL) return; + isc_log_destroy(&log); isc_log_setcontext(NULL); dns_log_setcontext(NULL); - logp = NULL; } void From f5ee6f729277b2b2f37c17c3db96ff73db22d715 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:06:09 +1100 Subject: [PATCH 04/74] use %u rather than %d; pass a unsigned int pointer --- bin/named/server.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index 68aca3559f..985925a84b 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -10827,7 +10827,7 @@ named_server_setdebuglevel(named_server_t *server, isc_lex_t *lex) { isc_log_setdebuglevel(named_g_lctx, named_g_debuglevel); isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_INFO, - "debug level is now %d", named_g_debuglevel); + "debug level is now %u", named_g_debuglevel); return (ISC_R_SUCCESS); } @@ -11383,7 +11383,7 @@ named_server_tsigdelete(named_server_t *server, isc_lex_t *lex, } isc_task_endexclusive(server->task); - snprintf(fbuf, sizeof(fbuf), "%d", foundkeys); + snprintf(fbuf, sizeof(fbuf), "%u", foundkeys); CHECK(putstr(text, fbuf)); CHECK(putstr(text, " tsig keys deleted.")); @@ -14813,9 +14813,11 @@ named_server_dnstap(named_server_t *server, isc_lex_t *lex, unsigned int n; ptr = next_token(lex, text); if (ptr != NULL) { - n = sscanf(ptr, "%u", &backups); - if (n != 1U) + unsigned int u; + n = sscanf(ptr, "%u", &u); + if (n != 1U || u > INT_MAX) return (ISC_R_BADNUMBER); + backups = u; } else { backups = ISC_LOG_ROLLINFINITE; } From 3fb7b9827a2e72a3c57b77aa26122753aa9399d6 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:08:06 +1100 Subject: [PATCH 05/74] use %u instead of %d --- bin/pkcs11/pkcs11-destroy.c | 2 +- util/copyrights | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pkcs11/pkcs11-destroy.c b/bin/pkcs11/pkcs11-destroy.c index 0f31a78a58..81f4db2cdb 100644 --- a/bin/pkcs11/pkcs11-destroy.c +++ b/bin/pkcs11/pkcs11-destroy.c @@ -232,7 +232,7 @@ main(int argc, char *argv[]) { if (wait != 0) { printf("WARNING: This action is irreversible! " - "Destroying key objects in %d seconds\n ", wait); + "Destroying key objects in %u seconds\n ", wait); for (i = 0; i < wait; i++) { printf("."); fflush(stdout); diff --git a/util/copyrights b/util/copyrights index 9a0f62304f..e30b408631 100644 --- a/util/copyrights +++ b/util/copyrights @@ -242,7 +242,7 @@ ./bin/pkcs11/openssl-1.0.1t-patch X 2016 ./bin/pkcs11/openssl-1.0.2h-patch X 2016 ./bin/pkcs11/pkcs11-destroy.8 MAN DOCBOOK -./bin/pkcs11/pkcs11-destroy.c X 2009,2010,2014,2015 +./bin/pkcs11/pkcs11-destroy.c X 2009,2010,2014,2015,2018 ./bin/pkcs11/pkcs11-destroy.docbook SGML 2009,2014,2015,2016 ./bin/pkcs11/pkcs11-destroy.html HTML DOCBOOK ./bin/pkcs11/pkcs11-keygen.8 MAN DOCBOOK From f9a9ff57ce38bb56d87c878a88d8948a7e1b9d22 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:18:12 +1100 Subject: [PATCH 06/74] use %u instead of %i --- bin/pkcs11/pkcs11-list.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/pkcs11/pkcs11-list.c b/bin/pkcs11/pkcs11-list.c index c79ee9ace6..05d24d9dee 100644 --- a/bin/pkcs11/pkcs11-list.c +++ b/bin/pkcs11/pkcs11-list.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2014-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -125,7 +125,7 @@ main(int argc, char *argv[]) { printf("slot %lu\n", slot); if (id) { - printf("id %i\n", id); + printf("id %u\n", id); attr_id[0] = (id >> 8) & 0xff; attr_id[1] = id & 0xff; } else if (label != NULL) { diff --git a/util/copyrights b/util/copyrights index e30b408631..1ef4776c90 100644 --- a/util/copyrights +++ b/util/copyrights @@ -250,7 +250,7 @@ ./bin/pkcs11/pkcs11-keygen.docbook SGML 2009,2014,2015,2016,2017 ./bin/pkcs11/pkcs11-keygen.html HTML DOCBOOK ./bin/pkcs11/pkcs11-list.8 MAN DOCBOOK -./bin/pkcs11/pkcs11-list.c C 2009,2014,2015,2016 +./bin/pkcs11/pkcs11-list.c C 2009,2014,2015,2016,2018 ./bin/pkcs11/pkcs11-list.docbook SGML 2009,2014,2015,2016 ./bin/pkcs11/pkcs11-list.html HTML DOCBOOK ./bin/pkcs11/pkcs11-tokens.8 MAN DOCBOOK From e08b3d3a48efb7bc63fbdbf9d320cd0348ff3464 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:20:46 +1100 Subject: [PATCH 07/74] use %u instead of %d --- bin/tests/dst/dst_test.c | 18 +++++++++--------- util/copyrights | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/tests/dst/dst_test.c b/bin/tests/dst/dst_test.c index 879746a023..7fbfc24101 100644 --- a/bin/tests/dst/dst_test.c +++ b/bin/tests/dst/dst_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001, 2004, 2005, 2007, 2009, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2004, 2005, 2007, 2009, 2012, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -54,7 +54,7 @@ use(dst_key_t *key, isc_mem_t *mctx) { ret = dst_context_create3(key, mctx, DNS_LOGCATEGORY_GENERAL, ISC_TRUE, &ctx); if (ret != ISC_R_SUCCESS) { - printf("contextcreate(%d) returned: %s\n", dst_key_alg(key), + printf("contextcreate(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); return; } @@ -87,7 +87,7 @@ use(dst_key_t *key, isc_mem_t *mctx) { return; } ret = dst_context_verify(ctx, &sigreg); - printf("verify(%d) returned: %s\n", dst_key_alg(key), + printf("verify(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); dst_context_destroy(&ctx); } @@ -104,19 +104,19 @@ dns(dst_key_t *key, isc_mem_t *mctx) { isc_buffer_init(&buf1, buffer1, sizeof(buffer1)); ret = dst_key_todns(key, &buf1); - printf("todns(%d) returned: %s\n", dst_key_alg(key), + printf("todns(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); if (ret != ISC_R_SUCCESS) return; ret = dst_key_fromdns(dst_key_name(key), dns_rdataclass_in, &buf1, mctx, &newkey); - printf("fromdns(%d) returned: %s\n", dst_key_alg(key), + printf("fromdns(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); if (ret != ISC_R_SUCCESS) return; isc_buffer_init(&buf2, buffer2, sizeof(buffer2)); ret = dst_key_todns(newkey, &buf2); - printf("todns2(%d) returned: %s\n", dst_key_alg(key), + printf("todns2(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); if (ret != ISC_R_SUCCESS) return; @@ -124,7 +124,7 @@ dns(dst_key_t *key, isc_mem_t *mctx) { isc_buffer_usedregion(&buf2, &r2); match = ISC_TF(r1.length == r2.length && memcmp(r1.base, r2.base, r1.length) == 0); - printf("compare(%d): %s\n", dst_key_alg(key), + printf("compare(%u): %s\n", dst_key_alg(key), match ? "true" : "false"); dst_key_free(&newkey); } @@ -194,11 +194,11 @@ dh(dns_name_t *name1, int id1, dns_name_t *name2, int id2, isc_mem_t *mctx) { { int i; printf("secrets don't match\n"); - printf("secret 1: %d bytes\n", r1.length); + printf("secret 1: %u bytes\n", r1.length); for (i = 0; i < (int) r1.length; i++) printf("%02x ", r1.base[i]); printf("\n"); - printf("secret 2: %d bytes\n", r2.length); + printf("secret 2: %u bytes\n", r2.length); for (i = 0; i < (int) r2.length; i++) printf("%02x ", r2.base[i]); printf("\n"); diff --git a/util/copyrights b/util/copyrights index 1ef4776c90..f38861804c 100644 --- a/util/copyrights +++ b/util/copyrights @@ -434,7 +434,7 @@ ./bin/tests/dst/Ktest.+003+49667.key.in X 2001,2004,2013 ./bin/tests/dst/Makefile.in MAKE 1999,2000,2001,2002,2004,2006,2007,2008,2009,2010,2012,2013,2014,2016,2017 ./bin/tests/dst/dst_2_data.in X 1999,2000,2001,2013 -./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2014,2015,2016 +./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2014,2015,2016,2018 ./bin/tests/dst/gsstest.c C 2006,2007,2009,2010,2011,2013,2014,2015,2016 ./bin/tests/dst/t2_data_1.in X 1999,2000,2001,2013 ./bin/tests/dst/t2_data_2.in X 1999,2000,2001,2013 From 3034da1ec6dbe1faa6509dfede97c275d1900b08 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:21:29 +1100 Subject: [PATCH 08/74] use %u instead of %d --- bin/tests/entropy2_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/entropy2_test.c b/bin/tests/entropy2_test.c index 0330aef18e..1545506cd1 100644 --- a/bin/tests/entropy2_test.c +++ b/bin/tests/entropy2_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -31,7 +31,7 @@ hex_dump(const char *msg, void *data, unsigned int length) { base = data; - printf("DUMP of %d bytes: %s\n\t", length, msg); + printf("DUMP of %u bytes: %s\n\t", length, msg); for (len = 0; len < length; len++) { if (len % 16 == 0 && !first) printf("\n\t"); diff --git a/util/copyrights b/util/copyrights index f38861804c..7cc515eb76 100644 --- a/util/copyrights +++ b/util/copyrights @@ -445,7 +445,7 @@ ./bin/tests/dst/win32/t_dst.vcxproj.filters.in X 2013,2015 ./bin/tests/dst/win32/t_dst.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/dst/win32/t_dst.vcxproj.user X 2013 -./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016 +./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016 ./bin/tests/fromhex.pl PERL 2015,2016 ./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016 From c8d294470db0659b86e9c73015b5db213bb0a0d9 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:21:56 +1100 Subject: [PATCH 09/74] use %u instead of %d --- bin/tests/entropy_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/entropy_test.c b/bin/tests/entropy_test.c index 38e285c971..d89a38c423 100644 --- a/bin/tests/entropy_test.c +++ b/bin/tests/entropy_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -29,7 +29,7 @@ hex_dump(const char *msg, void *data, unsigned int length) { base = data; - printf("DUMP of %d bytes: %s\n\t", length, msg); + printf("DUMP of %u bytes: %s\n\t", length, msg); for (len = 0; len < length; len++) { if (len % 16 == 0 && !first) printf("\n\t"); diff --git a/util/copyrights b/util/copyrights index 7cc515eb76..a38fa3062b 100644 --- a/util/copyrights +++ b/util/copyrights @@ -446,7 +446,7 @@ ./bin/tests/dst/win32/t_dst.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/dst/win32/t_dst.vcxproj.user X 2013 ./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 -./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016 +./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/fromhex.pl PERL 2015,2016 ./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016 ./bin/tests/hash_test.c C 2000,2001,2004,2005,2006,2007,2014,2015,2016,2017 From 4ec06278cca1890a101732ff3ccb54d5fa148536 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:24:22 +1100 Subject: [PATCH 10/74] use %u instead of %d --- bin/tests/fsaccess_test.c | 6 +++--- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/fsaccess_test.c b/bin/tests/fsaccess_test.c index 88035098e8..460f2a58cf 100644 --- a/bin/tests/fsaccess_test.c +++ b/bin/tests/fsaccess_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2012, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2004, 2005, 2007, 2012, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -54,11 +54,11 @@ main(void) { ISC_FSACCESS_READ | ISC_FSACCESS_WRITE, &access); - printf("fsaccess=%d\n", access); + printf("fsaccess=%u\n", access); isc_fsaccess_add(ISC_FSACCESS_OTHER, ISC_FSACCESS_READ, &access); - printf("fsaccess=%d\n", access); + printf("fsaccess=%u\n", access); result = isc_fsaccess_set(PATH, access); if (result != ISC_R_SUCCESS) diff --git a/util/copyrights b/util/copyrights index a38fa3062b..fb4d57ecf6 100644 --- a/util/copyrights +++ b/util/copyrights @@ -448,7 +448,7 @@ ./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/fromhex.pl PERL 2015,2016 -./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016 +./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016,2018 ./bin/tests/hash_test.c C 2000,2001,2004,2005,2006,2007,2014,2015,2016,2017 ./bin/tests/hashes/Makefile.in MAKE 2010,2012,2014,2016,2017 ./bin/tests/hashes/t_hashes.c C 2010,2013,2016 From 4278230b33a43ab537cb9ba5b5a3a70f85109d62 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:25:57 +1100 Subject: [PATCH 11/74] use %u instead of %d --- bin/tests/inter_test.c | 8 +++----- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/tests/inter_test.c b/bin/tests/inter_test.c index 3c26ba3d0a..3caa2d2fe4 100644 --- a/bin/tests/inter_test.c +++ b/bin/tests/inter_test.c @@ -1,13 +1,11 @@ /* - * Copyright (C) 2000, 2001, 2003-2005, 2007, 2008, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2003-2005, 2007, 2008, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: inter_test.c,v 1.16 2008/03/20 23:47:00 tbox Exp $ */ - /*! \file */ #include @@ -42,7 +40,7 @@ main(int argc, char **argv) { isc_result_totext(result)); continue; } - fprintf(stdout, "%s %d %x\n", ifdata.name, ifdata.af, + fprintf(stdout, "%s %u %x\n", ifdata.name, ifdata.af, ifdata.flags); INSIST(ifdata.af == AF_INET || ifdata.af == AF_INET6); res = inet_ntop(ifdata.af, &ifdata.address.type, buf, @@ -89,7 +87,7 @@ main(int argc, char **argv) { isc_result_totext(result)); continue; } - fprintf(stdout, "%s %d %x\n", ifdata.name, ifdata.af, + fprintf(stdout, "%s %u %x\n", ifdata.name, ifdata.af, ifdata.flags); INSIST(ifdata.af == AF_INET || ifdata.af == AF_INET6); res = inet_ntop(ifdata.af, &ifdata.address.type, buf, diff --git a/util/copyrights b/util/copyrights index fb4d57ecf6..144340248a 100644 --- a/util/copyrights +++ b/util/copyrights @@ -456,7 +456,7 @@ ./bin/tests/hashes/win32/t_hashes.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/hashes/win32/t_hashes.vcxproj.user X 2013 ./bin/tests/headerdep_test.sh.in SH 2000,2001,2004,2007,2012,2016 -./bin/tests/inter_test.c C 2000,2001,2003,2004,2005,2007,2008,2015,2016 +./bin/tests/inter_test.c C 2000,2001,2003,2004,2005,2007,2008,2015,2016,2018 ./bin/tests/keyboard_test.c C 2000,2001,2004,2005,2007,2015,2016 ./bin/tests/lex_test.c C 1998,1999,2000,2001,2004,2005,2007,2015,2016 ./bin/tests/lfsr_test.c C 1999,2000,2001,2004,2005,2007,2015,2016 From 6b74dcca71fdbd24cce345906c065256d0ddfad1 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:32:49 +1100 Subject: [PATCH 12/74] report argument error in human form --- bin/tests/name_test.c | 12 +++++------- util/copyrights | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bin/tests/name_test.c b/bin/tests/name_test.c index 1a154fe496..57081c19c1 100644 --- a/bin/tests/name_test.c +++ b/bin/tests/name_test.c @@ -1,13 +1,11 @@ /* - * Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2015-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2015-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* $Id: name_test.c,v 1.43 2009/09/02 23:48:01 tbox Exp $ */ - #include #include @@ -123,8 +121,8 @@ main(int argc, char *argv[]) { dns_rootname, 0, NULL); if (result != 0) { fprintf(stderr, - "dns_name_fromtext() failed: %d\n", - result); + "dns_name_fromtext() failed: %s\n", + dns_result_totext(result)); exit(1); } origin = &oname.name; @@ -147,8 +145,8 @@ main(int argc, char *argv[]) { 0, NULL); if (result != 0) { fprintf(stderr, - "dns_name_fromtext() failed: %d\n", - result); + "dns_name_fromtext() failed: %s\n", + dns_result_totext(result)); exit(1); } } diff --git a/util/copyrights b/util/copyrights index 144340248a..2d8375ccd7 100644 --- a/util/copyrights +++ b/util/copyrights @@ -496,7 +496,7 @@ ./bin/tests/mem/win32/t_mem.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/mem/win32/t_mem.vcxproj.user X 2013 ./bin/tests/mempool_test.c C 1999,2000,2001,2004,2007,2016 -./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017 +./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 ./bin/tests/named.conf CONF-C 1999,2000,2001,2004,2007,2011,2015,2016 ./bin/tests/names/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/names/dns_name_compare_data X 1999,2000,2001 From ee49362e33e144e3b4f8dfb83115460402a4b360 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:36:08 +1100 Subject: [PATCH 13/74] make declarations consistent --- bin/tests/rbt/t_rbt.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/rbt/t_rbt.c b/bin/tests/rbt/t_rbt.c index f05da74b3a..5acae8173d 100644 --- a/bin/tests/rbt/t_rbt.c +++ b/bin/tests/rbt/t_rbt.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2011-2013, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2003-2005, 2007, 2009, 2011-2013, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -33,9 +33,9 @@ char *Tokens[T_MAXTOKS]; static int t_dns_rbtnodechain_init(char *dbfile, char *findname, - char *firstname, char *firstorigin, char *nextname, char *nextorigin, char *prevname, char *prevorigin, + char *firstname, char *firstorigin, char *lastname, char *lastorigin); static char * fixedname_totext(dns_fixedname_t *name); diff --git a/util/copyrights b/util/copyrights index 2d8375ccd7..75f1ff7a84 100644 --- a/util/copyrights +++ b/util/copyrights @@ -585,7 +585,7 @@ ./bin/tests/rbt/dns_rbtnodechain_next_data X 1999,2000,2001 ./bin/tests/rbt/dns_rbtnodechain_prev.data X 1999,2000,2001 ./bin/tests/rbt/dns_rbtnodechain_prev_data X 1999,2000,2001 -./bin/tests/rbt/t_rbt.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2013,2015,2016 +./bin/tests/rbt/t_rbt.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2013,2015,2016,2018 ./bin/tests/rbt/win32/t_rbt.vcxproj.filters.in X 2013,2015 ./bin/tests/rbt/win32/t_rbt.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/rbt/win32/t_rbt.vcxproj.user X 2013 From f0981d968274ad24d4574e0d5632dc4a3c2babfb Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:39:05 +1100 Subject: [PATCH 14/74] use %u instead of %d --- bin/tests/rbt_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/rbt_test.c b/bin/tests/rbt_test.c index c0586fc12c..f536c9fe47 100644 --- a/bin/tests/rbt_test.c +++ b/bin/tests/rbt_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001, 2004, 2005, 2007, 2009, 2011, 2012, 2014-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2004, 2005, 2007, 2009, 2011, 2012, 2014-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -177,7 +177,7 @@ detail(dns_rbt_t *rbt, dns_name_t *name) { printf("\n result from dns_rbtnodechain_current: %s\n", dns_result_totext(result)); - printf(" level_matches = %d, level_count = %d\n", + printf(" level_matches = %u, level_count = %u\n", chain.level_matches, chain.level_count); } diff --git a/util/copyrights b/util/copyrights index 75f1ff7a84..59399003ee 100644 --- a/util/copyrights +++ b/util/copyrights @@ -589,7 +589,7 @@ ./bin/tests/rbt/win32/t_rbt.vcxproj.filters.in X 2013,2015 ./bin/tests/rbt/win32/t_rbt.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/rbt/win32/t_rbt.vcxproj.user X 2013 -./bin/tests/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016 +./bin/tests/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016,2018 ./bin/tests/rbt_test.out X 1999,2000,2001 ./bin/tests/rbt_test.txt SH 1999,2000,2001,2004,2007,2012,2016 ./bin/tests/resolv.conf.sample CONF-SH 2000,2001,2004,2007,2012,2016 From af7fd8930581942a2645119bd48f8910488a80d4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:39:31 +1100 Subject: [PATCH 15/74] use %u instead of %d --- bin/tests/rwlock_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/rwlock_test.c b/bin/tests/rwlock_test.c index 5a542312e3..8cf7c708ea 100644 --- a/bin/tests/rwlock_test.c +++ b/bin/tests/rwlock_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2005, 2007, 2013, 2016, 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2005, 2007, 2013, 2016-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -104,7 +104,7 @@ main(int argc, char *argv[]) { nworkers = 2; if (nworkers > 100) nworkers = 100; - printf("%d workers\n", nworkers); + printf("%u workers\n", nworkers); RUNTIME_CHECK(isc_rwlock_init(&lock, 5, 10) == ISC_R_SUCCESS); diff --git a/util/copyrights b/util/copyrights index 59399003ee..dd1bf2988f 100644 --- a/util/copyrights +++ b/util/copyrights @@ -598,7 +598,7 @@ ./bin/tests/resolver/win32/t_resolver.vcxproj.filters.in X 2013,2015 ./bin/tests/resolver/win32/t_resolver.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/resolver/win32/t_resolver.vcxproj.user X 2013 -./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017 +./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017,2018 ./bin/tests/serial_test.c C 1999,2000,2001,2003,2004,2007,2015,2016 ./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017 ./bin/tests/sig0_test.c C 2000,2001,2004,2005,2007,2008,2009,2012,2015,2016 From 5c017fd3f6eb8ceb33416e0954fbc2ace7e80a35 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:41:08 +1100 Subject: [PATCH 16/74] use %u instead of %d --- bin/tests/shutdown_test.c | 6 +++--- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/shutdown_test.c b/bin/tests/shutdown_test.c index 11f6aacc6e..923aac0230 100644 --- a/bin/tests/shutdown_test.c +++ b/bin/tests/shutdown_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2007, 2011, 2013, 2016, 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2007, 2011, 2013, 2016-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -139,7 +139,7 @@ new_task(isc_mem_t *mctx, const char *name) { INSIST(strlen(name) < sizeof(ti->name)); strlcpy(ti->name, name, sizeof(ti->name)); } else { - snprintf(ti->name, sizeof(ti->name), "%d", task_count); + snprintf(ti->name, sizeof(ti->name), "%u", task_count); } RUNTIME_CHECK(isc_task_create(task_manager, 0, &ti->task) == ISC_R_SUCCESS); @@ -175,7 +175,7 @@ main(int argc, char *argv[]) { workers = 8192; } else workers = 2; - printf("%d workers\n", workers); + printf("%u workers\n", workers); mctx = NULL; RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); diff --git a/util/copyrights b/util/copyrights index dd1bf2988f..b6b1f139a7 100644 --- a/util/copyrights +++ b/util/copyrights @@ -600,7 +600,7 @@ ./bin/tests/resolver/win32/t_resolver.vcxproj.user X 2013 ./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017,2018 ./bin/tests/serial_test.c C 1999,2000,2001,2003,2004,2007,2015,2016 -./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017 +./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017,2018 ./bin/tests/sig0_test.c C 2000,2001,2004,2005,2007,2008,2009,2012,2015,2016 ./bin/tests/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017 ./bin/tests/sockaddr/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 From c4ca99c0d1f6b778b136994618dd3dda5b378b76 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:46:15 +1100 Subject: [PATCH 17/74] use %u instead of %d --- bin/tests/sock_test.c | 18 +++++++++--------- util/copyrights | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/tests/sock_test.c b/bin/tests/sock_test.c index 8463414c1c..1846eb2139 100644 --- a/bin/tests/sock_test.c +++ b/bin/tests/sock_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2007, 2008, 2012-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2007, 2008, 2012-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -42,8 +42,8 @@ my_send(isc_task_t *task, isc_event_t *event) { sock = event->ev_sender; dev = (isc_socketevent_t *)event; - printf("my_send: %s task %p\n\t(sock %p, base %p, length %d, n %d, " - "result %d)\n", + printf("my_send: %s task %p\n\t(sock %p, base %p, length %u, n %u, " + "result %u)\n", (char *)(event->ev_arg), task, sock, dev->region.base, dev->region.length, dev->n, dev->result); @@ -70,7 +70,7 @@ my_recv(isc_task_t *task, isc_event_t *event) { sock = event->ev_sender; dev = (isc_socketevent_t *)event; - printf("Socket %s (sock %p, base %p, length %d, n %d, result %d)\n", + printf("Socket %s (sock %p, base %p, length %u, n %u, result %u)\n", (char *)(event->ev_arg), sock, dev->region.base, dev->region.length, dev->n, dev->result); @@ -130,8 +130,8 @@ my_http_get(isc_task_t *task, isc_event_t *event) { sock = event->ev_sender; dev = (isc_socketevent_t *)event; - printf("my_http_get: %s task %p\n\t(sock %p, base %p, length %d, " - "n %d, result %d)\n", + printf("my_http_get: %s task %p\n\t(sock %p, base %p, length %u, " + "n %u, result %u)\n", (char *)(event->ev_arg), task, sock, dev->region.base, dev->region.length, dev->n, dev->result); @@ -160,7 +160,7 @@ my_connect(isc_task_t *task, isc_event_t *event) { sock = event->ev_sender; dev = (isc_socket_connev_t *)event; - printf("%s: Connection result: %d\n", (char *)(event->ev_arg), + printf("%s: Connection result: %u\n", (char *)(event->ev_arg), dev->result); if (dev->result != ISC_R_SUCCESS) { @@ -200,7 +200,7 @@ my_listen(isc_task_t *task, isc_event_t *event) { dev = (isc_socket_newconnev_t *)event; - printf("newcon %s (task %p, oldsock %p, newsock %p, result %d)\n", + printf("newcon %s (task %p, oldsock %p, newsock %p, result %u)\n", name, task, event->ev_sender, dev->newsocket, dev->result); fflush(stdout); @@ -279,7 +279,7 @@ main(int argc, char *argv[]) { workers = 8192; } else workers = 2; - printf("%d workers\n", workers); + printf("%u workers\n", workers); if (isc_net_probeipv6() == ISC_R_SUCCESS) pf = PF_INET6; diff --git a/util/copyrights b/util/copyrights index b6b1f139a7..5a978ac426 100644 --- a/util/copyrights +++ b/util/copyrights @@ -602,7 +602,7 @@ ./bin/tests/serial_test.c C 1999,2000,2001,2003,2004,2007,2015,2016 ./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017,2018 ./bin/tests/sig0_test.c C 2000,2001,2004,2005,2007,2008,2009,2012,2015,2016 -./bin/tests/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017 +./bin/tests/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017,2018 ./bin/tests/sockaddr/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/sockaddr/t_sockaddr.c C 1999,2000,2001,2004,2007,2013,2016 ./bin/tests/sockaddr/win32/t_sockaddr.vcxproj.filters.in X 2013,2015 From bbdd8e17d7a68b9a866ae2d53bf92a14975acc00 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 18:54:05 +1100 Subject: [PATCH 18/74] copyrights --- util/copyrights | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/util/copyrights b/util/copyrights index 5a978ac426..15deab8ae9 100644 --- a/util/copyrights +++ b/util/copyrights @@ -77,17 +77,17 @@ ./bin/dig/.gitignore X 2012,2014 ./bin/dig/Makefile.in MAKE 2000,2001,2002,2004,2005,2007,2009,2012,2013,2014,2015,2016,2017 ./bin/dig/dig.1 MAN DOCBOOK -./bin/dig/dig.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./bin/dig/dig.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dig/dig.docbook SGML 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2013,2014,2015,2016,2017,2018 ./bin/dig/dig.html HTML DOCBOOK -./bin/dig/dighost.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./bin/dig/dighost.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dig/host.1 MAN DOCBOOK -./bin/dig/host.c C 2000,2001,2002,2003,2004,2005,2006,2007,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./bin/dig/host.c C 2000,2001,2002,2003,2004,2005,2006,2007,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dig/host.docbook SGML 2000,2001,2002,2004,2005,2007,2008,2009,2014,2015,2016,2017 ./bin/dig/host.html HTML DOCBOOK -./bin/dig/include/dig/dig.h C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 +./bin/dig/include/dig/dig.h C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dig/nslookup.1 MAN DOCBOOK -./bin/dig/nslookup.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./bin/dig/nslookup.c C 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dig/nslookup.docbook SGML 2004,2005,2006,2007,2010,2013,2014,2015,2016,2017 ./bin/dig/nslookup.html HTML DOCBOOK ./bin/dig/win32/dig.vcxproj.filters.in X 2013,2015 @@ -133,7 +133,7 @@ ./bin/dnssec/dnssec-settime.docbook SGML 2009,2010,2011,2014,2015,2016,2017 ./bin/dnssec/dnssec-settime.html HTML DOCBOOK ./bin/dnssec/dnssec-signzone.8 MAN DOCBOOK -./bin/dnssec/dnssec-signzone.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 +./bin/dnssec/dnssec-signzone.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./bin/dnssec/dnssec-signzone.docbook SGML 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 ./bin/dnssec/dnssec-signzone.html HTML DOCBOOK ./bin/dnssec/dnssec-verify.8 MAN DOCBOOK @@ -242,7 +242,7 @@ ./bin/pkcs11/openssl-1.0.1t-patch X 2016 ./bin/pkcs11/openssl-1.0.2h-patch X 2016 ./bin/pkcs11/pkcs11-destroy.8 MAN DOCBOOK -./bin/pkcs11/pkcs11-destroy.c X 2009,2010,2014,2015,2018 +./bin/pkcs11/pkcs11-destroy.c X 2009,2010,2014,2015,2018 ./bin/pkcs11/pkcs11-destroy.docbook SGML 2009,2014,2015,2016 ./bin/pkcs11/pkcs11-destroy.html HTML DOCBOOK ./bin/pkcs11/pkcs11-keygen.8 MAN DOCBOOK @@ -250,7 +250,7 @@ ./bin/pkcs11/pkcs11-keygen.docbook SGML 2009,2014,2015,2016,2017 ./bin/pkcs11/pkcs11-keygen.html HTML DOCBOOK ./bin/pkcs11/pkcs11-list.8 MAN DOCBOOK -./bin/pkcs11/pkcs11-list.c C 2009,2014,2015,2016,2018 +./bin/pkcs11/pkcs11-list.c C 2009,2014,2015,2016,2018 ./bin/pkcs11/pkcs11-list.docbook SGML 2009,2014,2015,2016 ./bin/pkcs11/pkcs11-list.html HTML DOCBOOK ./bin/pkcs11/pkcs11-tokens.8 MAN DOCBOOK @@ -434,7 +434,7 @@ ./bin/tests/dst/Ktest.+003+49667.key.in X 2001,2004,2013 ./bin/tests/dst/Makefile.in MAKE 1999,2000,2001,2002,2004,2006,2007,2008,2009,2010,2012,2013,2014,2016,2017 ./bin/tests/dst/dst_2_data.in X 1999,2000,2001,2013 -./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2014,2015,2016,2018 +./bin/tests/dst/dst_test.c C 1999,2000,2001,2004,2005,2007,2009,2012,2014,2015,2016,2018 ./bin/tests/dst/gsstest.c C 2006,2007,2009,2010,2011,2013,2014,2015,2016 ./bin/tests/dst/t2_data_1.in X 1999,2000,2001,2013 ./bin/tests/dst/t2_data_2.in X 1999,2000,2001,2013 @@ -445,10 +445,10 @@ ./bin/tests/dst/win32/t_dst.vcxproj.filters.in X 2013,2015 ./bin/tests/dst/win32/t_dst.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/dst/win32/t_dst.vcxproj.user X 2013 -./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 -./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/entropy2_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 +./bin/tests/entropy_test.c C 2000,2001,2004,2005,2007,2015,2016,2018 ./bin/tests/fromhex.pl PERL 2015,2016 -./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016,2018 +./bin/tests/fsaccess_test.c C 2000,2001,2004,2005,2007,2012,2015,2016,2018 ./bin/tests/hash_test.c C 2000,2001,2004,2005,2006,2007,2014,2015,2016,2017 ./bin/tests/hashes/Makefile.in MAKE 2010,2012,2014,2016,2017 ./bin/tests/hashes/t_hashes.c C 2010,2013,2016 @@ -456,7 +456,7 @@ ./bin/tests/hashes/win32/t_hashes.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/hashes/win32/t_hashes.vcxproj.user X 2013 ./bin/tests/headerdep_test.sh.in SH 2000,2001,2004,2007,2012,2016 -./bin/tests/inter_test.c C 2000,2001,2003,2004,2005,2007,2008,2015,2016,2018 +./bin/tests/inter_test.c C 2000,2001,2003,2004,2005,2007,2008,2015,2016,2018 ./bin/tests/keyboard_test.c C 2000,2001,2004,2005,2007,2015,2016 ./bin/tests/lex_test.c C 1998,1999,2000,2001,2004,2005,2007,2015,2016 ./bin/tests/lfsr_test.c C 1999,2000,2001,2004,2005,2007,2015,2016 @@ -496,7 +496,7 @@ ./bin/tests/mem/win32/t_mem.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/mem/win32/t_mem.vcxproj.user X 2013 ./bin/tests/mempool_test.c C 1999,2000,2001,2004,2007,2016 -./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 +./bin/tests/name_test.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017,2018 ./bin/tests/named.conf CONF-C 1999,2000,2001,2004,2007,2011,2015,2016 ./bin/tests/names/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/names/dns_name_compare_data X 1999,2000,2001 @@ -585,11 +585,11 @@ ./bin/tests/rbt/dns_rbtnodechain_next_data X 1999,2000,2001 ./bin/tests/rbt/dns_rbtnodechain_prev.data X 1999,2000,2001 ./bin/tests/rbt/dns_rbtnodechain_prev_data X 1999,2000,2001 -./bin/tests/rbt/t_rbt.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2013,2015,2016,2018 +./bin/tests/rbt/t_rbt.c C 1998,1999,2000,2001,2003,2004,2005,2007,2009,2011,2012,2013,2015,2016,2018 ./bin/tests/rbt/win32/t_rbt.vcxproj.filters.in X 2013,2015 ./bin/tests/rbt/win32/t_rbt.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/rbt/win32/t_rbt.vcxproj.user X 2013 -./bin/tests/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016,2018 +./bin/tests/rbt_test.c C 1999,2000,2001,2004,2005,2007,2009,2011,2012,2014,2015,2016,2018 ./bin/tests/rbt_test.out X 1999,2000,2001 ./bin/tests/rbt_test.txt SH 1999,2000,2001,2004,2007,2012,2016 ./bin/tests/resolv.conf.sample CONF-SH 2000,2001,2004,2007,2012,2016 @@ -598,11 +598,11 @@ ./bin/tests/resolver/win32/t_resolver.vcxproj.filters.in X 2013,2015 ./bin/tests/resolver/win32/t_resolver.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/resolver/win32/t_resolver.vcxproj.user X 2013 -./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017,2018 +./bin/tests/rwlock_test.c C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017,2018 ./bin/tests/serial_test.c C 1999,2000,2001,2003,2004,2007,2015,2016 -./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017,2018 +./bin/tests/shutdown_test.c C 1998,1999,2000,2001,2004,2007,2011,2013,2016,2017,2018 ./bin/tests/sig0_test.c C 2000,2001,2004,2005,2007,2008,2009,2012,2015,2016 -./bin/tests/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017,2018 +./bin/tests/sock_test.c C 1998,1999,2000,2001,2004,2007,2008,2012,2013,2014,2015,2016,2017,2018 ./bin/tests/sockaddr/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/sockaddr/t_sockaddr.c C 1999,2000,2001,2004,2007,2013,2016 ./bin/tests/sockaddr/win32/t_sockaddr.vcxproj.filters.in X 2013,2015 From 865115f30c00d6eb855ac58c4af48838ab84e7a8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:07:27 +1100 Subject: [PATCH 19/74] use %u instead of %d --- bin/tests/system/rpz/dnsrps.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/rpz/dnsrps.c b/bin/tests/system/rpz/dnsrps.c index 6e26106032..373c19fe9b 100644 --- a/bin/tests/system/rpz/dnsrps.c +++ b/bin/tests/system/rpz/dnsrps.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2017, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -125,7 +125,7 @@ main(int argc, char **argv) { } librpz->rsp_detach(&rsp); librpz->client_detach(&client); - printf("%d\n", serial); + printf("%u\n", serial); return (0); #else INSIST(0); diff --git a/util/copyrights b/util/copyrights index 15deab8ae9..960a688436 100644 --- a/util/copyrights +++ b/util/copyrights @@ -1994,7 +1994,7 @@ ./bin/tests/system/rpz/Makefile.in MAKE 2017 ./bin/tests/system/rpz/ckdnsrps.sh SH 2017 ./bin/tests/system/rpz/clean.sh SH 2011,2012,2013,2014,2016,2017 -./bin/tests/system/rpz/dnsrps.c C 2017 +./bin/tests/system/rpz/dnsrps.c C 2017,2018 ./bin/tests/system/rpz/dnsrpzd-license.conf X 2017 ./bin/tests/system/rpz/dnsrpzd.conf CONF-C 2017 ./bin/tests/system/rpz/ns1/named.conf CONF-C 2011,2013,2016,2017 From e24733619955f300b3f764e10f999b03f994c4ca Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:08:18 +1100 Subject: [PATCH 20/74] use %u instead of %d --- bin/tests/task_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/task_test.c b/bin/tests/task_test.c index bcbfde364d..dd60feb3b7 100644 --- a/bin/tests/task_test.c +++ b/bin/tests/task_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2007, 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2007, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -76,7 +76,7 @@ main(int argc, char *argv[]) { workers = 8192; } else workers = 2; - printf("%d workers\n", workers); + printf("%u workers\n", workers); RUNTIME_CHECK(isc_mem_create(0, 0, &mctx) == ISC_R_SUCCESS); diff --git a/util/copyrights b/util/copyrights index 960a688436..eca5b40f94 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2522,7 +2522,7 @@ ./bin/tests/system/zonechecks/setup.sh SH 2012,2013,2014,2015,2016,2017 ./bin/tests/system/zonechecks/tests.sh SH 2004,2007,2009,2012,2013,2014,2015,2016 ./bin/tests/t_api.pl PERL 1999,2000,2001,2004,2007,2012,2016 -./bin/tests/task_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016 +./bin/tests/task_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018 ./bin/tests/tasks/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/tasks/t_tasks.c C 1998,1999,2000,2001,2004,2005,2007,2009,2011,2013,2014,2015,2016 ./bin/tests/tasks/win32/t_tasks.vcxproj.filters.in X 2013,2015 From 372fbc06e76c6110a1de0c69a2b85a6de44fce1e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:08:40 +1100 Subject: [PATCH 21/74] use %u instead of %d --- bin/tests/timer_test.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/timer_test.c b/bin/tests/timer_test.c index 790ce40574..5f6015bdcb 100644 --- a/bin/tests/timer_test.c +++ b/bin/tests/timer_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2007, 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2007, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -106,7 +106,7 @@ main(int argc, char *argv[]) { workers = 8192; } else workers = 2; - printf("%d workers\n", workers); + printf("%u workers\n", workers); RUNTIME_CHECK(isc_mem_create(0, 0, &mctx1) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_taskmgr_create(mctx1, workers, 0, &manager) == diff --git a/util/copyrights b/util/copyrights index eca5b40f94..95a0faa6b0 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2528,7 +2528,7 @@ ./bin/tests/tasks/win32/t_tasks.vcxproj.filters.in X 2013,2015 ./bin/tests/tasks/win32/t_tasks.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/tasks/win32/t_tasks.vcxproj.user X 2013,2015 -./bin/tests/timer_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016 +./bin/tests/timer_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018 ./bin/tests/timers/Makefile.in MAKE 1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 ./bin/tests/timers/t_timers.c C 1999,2000,2001,2004,2007,2008,2009,2011,2013,2016 ./bin/tests/timers/win32/t_timers.vcxproj.filters.in X 2013,2015 From 1af3e7d7d5092e7665f2a9b84c1c51bff53e7d83 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:09:23 +1100 Subject: [PATCH 22/74] use %u instead of %d --- bin/tools/mdig.c | 6 +++--- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index 5c81527771..8dbc49ab6c 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1378,12 +1378,12 @@ plus_option(char *option, struct query *query, isc_boolean_t global) result = parse_uint(&display_splitwidth, value, 1023, "split"); - if (display_splitwidth % 4 != 0) { + if ((display_splitwidth % 4) != 0) { display_splitwidth = ((display_splitwidth + 3) / 4) * 4; fprintf(stderr, ";; Warning, split must be " "a multiple of 4; adjusting " - "to %d\n", + "to %u\n", display_splitwidth); } /* diff --git a/util/copyrights b/util/copyrights index 95a0faa6b0..12b5a64bee 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2618,7 +2618,7 @@ ./bin/tools/genrandom.docbook SGML 2009,2010,2011,2014,2015,2016 ./bin/tools/genrandom.html HTML DOCBOOK ./bin/tools/mdig.1 MAN DOCBOOK -./bin/tools/mdig.c C 2015,2016,2017 +./bin/tools/mdig.c C 2015,2016,2017,2018 ./bin/tools/mdig.docbook SGML 2015,2016,2017 ./bin/tools/mdig.html HTML DOCBOOK ./bin/tools/named-journalprint.8 MAN DOCBOOK From 8aff92c1500136c352a5945c2cd432b57ec33c64 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:13:56 +1100 Subject: [PATCH 23/74] formally cast to int --- lib/dns/adb.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 9af022e7ff..8db5c27a35 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -3436,7 +3436,7 @@ static void dump_ttl(FILE *f, const char *legend, isc_stdtime_t value, isc_stdtime_t now) { if (value == INT_MAX) return; - fprintf(f, " [%s TTL %d]", legend, value - now); + fprintf(f, " [%s TTL %d]", legend, (int)(value - now)); } static void diff --git a/util/copyrights b/util/copyrights index 12b5a64bee..aaa989b828 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3298,7 +3298,7 @@ ./lib/dns/Kyuafile X 2017 ./lib/dns/Makefile.in MAKE 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/acl.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2011,2013,2014,2016,2017 -./lib/dns/adb.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/adb.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/api X 1999,2000,2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/badcache.c C 2014,2015,2016 ./lib/dns/byaddr.c C 2000,2001,2002,2003,2004,2005,2007,2009,2013,2016,2017 From 17d971a405a5ba2c8d46c5cf0f4f6a9334fcbd71 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:20:38 +1100 Subject: [PATCH 24/74] formally cast to int; use %u instead of %d --- lib/dns/adb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/adb.c b/lib/dns/adb.c index 8db5c27a35..b30f695139 100644 --- a/lib/dns/adb.c +++ b/lib/dns/adb.c @@ -3467,7 +3467,7 @@ dump_adb(dns_adb_t *adb, FILE *f, isc_boolean_t debug, isc_stdtime_t now) { if (name == NULL) continue; if (debug) - fprintf(f, "; bucket %d\n", i); + fprintf(f, "; bucket %u\n", i); for (; name != NULL; name = ISC_LIST_NEXT(name, plink)) @@ -3554,7 +3554,7 @@ dump_entry(FILE *f, dns_adb_t *adb, dns_adbentry_t *entry, fprintf(f, "]"); } if (entry->expires != 0) - fprintf(f, " [ttl %d]", entry->expires - now); + fprintf(f, " [ttl %d]", (int)(entry->expires - now)); if (adb != NULL && adb->quota != 0 && adb->atr_freq != 0) { fprintf(f, " [atr %0.2f] [quota %u]", @@ -3570,7 +3570,7 @@ dump_entry(FILE *f, dns_adb_t *adb, dns_adbentry_t *entry, print_dns_name(f, &li->qname); dns_rdatatype_format(li->qtype, typebuf, sizeof(typebuf)); fprintf(f, " %s [lame TTL %d]\n", typebuf, - li->lame_timer - now); + (int)(li->lame_timer - now)); } } From b1b9257c8f743f892734c825f70f22d1e6fc8250 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:24:48 +1100 Subject: [PATCH 25/74] test for >= 0 and use %d instead of %u --- lib/dns/catz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dns/catz.c b/lib/dns/catz.c index 4d771bebb2..5019ffa5bb 100644 --- a/lib/dns/catz.c +++ b/lib/dns/catz.c @@ -1545,9 +1545,9 @@ dns_catz_generate_zonecfg(dns_catz_zone_t *zone, dns_catz_entry_t *entry, * use the DSCP value set for the first master */ if (entry->opts.masters.count > 0 && - entry->opts.masters.dscps[0] != -1) { + entry->opts.masters.dscps[0] >= 0) { isc_buffer_putstr(buffer, " dscp "); - snprintf(pbuf, sizeof(pbuf), "%u", + snprintf(pbuf, sizeof(pbuf), "%d", entry->opts.masters.dscps[0]); isc_buffer_putstr(buffer, pbuf); } From a8fa4a9e4252ccf82310b0e207136cca4cde5870 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:26:37 +1100 Subject: [PATCH 26/74] use %u instead of %d --- lib/dns/dst_api.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index 9e7aef685d..2e1d695382 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1999-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1823,7 +1823,7 @@ write_public_key(const dst_key_t *key, int type, const char *directory) { fprintf(fp, " "); if (key->key_ttl != 0) - fprintf(fp, "%d ", key->key_ttl); + fprintf(fp, "%u ", key->key_ttl); isc_buffer_usedregion(&classb, &r); if ((unsigned) fwrite(r.base, 1, r.length, fp) != r.length) diff --git a/util/copyrights b/util/copyrights index aaa989b828..5bd4c0850c 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3320,7 +3320,7 @@ ./lib/dns/dnstap.c C 2015,2016,2017,2018 ./lib/dns/dnstap.proto X 2015 ./lib/dns/ds.c C 2002,2003,2004,2005,2006,2007,2010,2012,2014,2016 -./lib/dns/dst_api.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/dst_api.c C.NAI 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/dst_gost.h C 2014,2016 ./lib/dns/dst_internal.h C.NAI 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2016,2017 ./lib/dns/dst_lib.c C 1999,2000,2001,2004,2005,2007,2016 From 898d7e99a9e7e1596c4758b8bb56d94a2fbaeba2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:28:13 +1100 Subject: [PATCH 27/74] use %u instead of %d --- lib/dns/dst_parse.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c index c984c4ca57..5b64142de5 100644 --- a/lib/dns/dst_parse.c +++ b/lib/dns/dst_parse.c @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) 1999-2002, 2004-2017 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1999-2002, 2004-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -738,7 +738,7 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv, /* XXXDCL return value should be checked for full filesystem */ fprintf(fp, "%s v%d.%d\n", PRIVATE_KEY_STR, major, minor); - fprintf(fp, "%s %d ", ALGORITHM_STR, dst_key_alg(key)); + fprintf(fp, "%s %u ", ALGORITHM_STR, dst_key_alg(key)); /* XXXVIX this switch statement is too sparse to gen a jump table. */ switch (dst_key_alg(key)) { diff --git a/util/copyrights b/util/copyrights index 5bd4c0850c..18f926c69f 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3325,7 +3325,7 @@ ./lib/dns/dst_internal.h C.NAI 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2016,2017 ./lib/dns/dst_lib.c C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/dst_openssl.h C 2002,2004,2005,2007,2008,2009,2011,2012,2015,2016 -./lib/dns/dst_parse.c C.NAI 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/dst_parse.c C.NAI 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/dst_parse.h C.NAI 2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2012,2014,2016,2017 ./lib/dns/dst_pkcs11.h C 2014,2016 ./lib/dns/dst_result.c C 1999,2000,2001,2004,2005,2007,2008,2012,2013,2014,2015,2016 From 7d375efaeae5f4a85185290711867d2af306f219 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:31:16 +1100 Subject: [PATCH 28/74] INSIST ipnum6 != NULL --- lib/dns/geoip.c | 8 +++++--- util/copyrights | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/dns/geoip.c b/lib/dns/geoip.c index c27042c604..6abe9cfdb8 100644 --- a/lib/dns/geoip.c +++ b/lib/dns/geoip.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -189,10 +189,12 @@ set_state(unsigned int family, isc_uint32_t ipnum, const geoipv6_t *ipnum6, clean_state(state); #endif - if (family == AF_INET) + if (family == AF_INET) { state->ipnum = ipnum; - else + } else { + INSIST(ipnum6 != NULL); state->ipnum6 = *ipnum6; + } state->family = family; state->subtype = subtype; diff --git a/util/copyrights b/util/copyrights index 18f926c69f..26e997142b 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3336,7 +3336,7 @@ ./lib/dns/gen-unix.h C 1999,2000,2001,2004,2005,2007,2009,2016 ./lib/dns/gen-win32.h C 1999,2000,2001,2004,2005,2006,2007,2009,2014,2016 ./lib/dns/gen.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2012,2013,2014,2015,2016,2017 -./lib/dns/geoip.c C 2013,2014,2015,2016 +./lib/dns/geoip.c C 2013,2014,2015,2016,2018 ./lib/dns/gssapi_link.c C 2000,2001,2002,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016 ./lib/dns/gssapictx.c C 2000,2001,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/hmac_link.c C.NAI 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 From 4a3c1fb45e7773904fce128e13453c48a93738d5 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 19:33:25 +1100 Subject: [PATCH 29/74] use %u instead of %d --- lib/dns/masterdump.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c index 664ef6eed5..70b0537bef 100644 --- a/lib/dns/masterdump.c +++ b/lib/dns/masterdump.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2009, 2011-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2009, 2011-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1566,7 +1566,7 @@ writeheader(dns_dumpctx_t *dctx) { */ if (dctx->do_date) { fprintf(dctx->f, - "; using a %d second stale ttl\n", + "; using a %u second stale ttl\n", dctx->tctx.serve_stale_ttl); result = dns_time32_totext(dctx->now, &buffer); RUNTIME_CHECK(result == ISC_R_SUCCESS); diff --git a/util/copyrights b/util/copyrights index 26e997142b..a2b9f3c467 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3454,7 +3454,7 @@ ./lib/dns/lookup.c C 2000,2001,2003,2004,2005,2007,2013,2016 ./lib/dns/mapapi X 2013,2017 ./lib/dns/master.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 -./lib/dns/masterdump.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/masterdump.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/message.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/name.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/ncache.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2010,2011,2012,2013,2014,2015,2016,2017 From 2b803b34634428b3f817d9db33788b0a043fb4fe Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 20:32:51 +1100 Subject: [PATCH 30/74] prevent implict conversion to signed --- lib/dns/message.c | 6 +++--- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dns/message.c b/lib/dns/message.c index 541fafd056..95d9382947 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -3862,11 +3862,11 @@ dns_message_pseudosectiontotext(dns_message_t *msg, ADD_STRING(target, "; EXPIRE"); } else if (optcode == DNS_OPT_TCP_KEEPALIVE) { if (optlen == 2) { - isc_uint16_t dsecs; + unsigned int dsecs; dsecs = isc_buffer_getuint16(&optbuf); ADD_STRING(target, "; TCP KEEPALIVE:"); snprintf(buf, sizeof(buf), " %u.%u", - dsecs / 10, dsecs % 10); + dsecs / 10U, dsecs % 10U); ADD_STRING(target, buf); ADD_STRING(target, " secs\n"); continue; diff --git a/util/copyrights b/util/copyrights index a2b9f3c467..6173b1f1ba 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3455,7 +3455,7 @@ ./lib/dns/mapapi X 2013,2017 ./lib/dns/master.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/masterdump.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 -./lib/dns/message.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/message.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/name.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/ncache.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/nsec.c C 1999,2000,2001,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015,2016 From b234797536374a7c08bfd900701922a122abd47f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:00:17 +1100 Subject: [PATCH 31/74] use %u instead of %d --- lib/dns/rbt.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c index af1c865cb8..262d77dd16 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2005, 2007-2009, 2011-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2005, 2007-2009, 2011-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -3020,7 +3020,7 @@ dns_rbt_printnodeinfo(dns_rbtnode_t *n, FILE *f) { (n->down_is_relative == 1 ? " D" : ""), (n->data_is_relative == 1 ? " T" : "")); - fprintf(f, "node lock address = %d\n", n->locknum); + fprintf(f, "node lock address = %u\n", n->locknum); fprintf(f, "Parent: %p\n", n->parent); fprintf(f, "Right: %p\n", n->right); diff --git a/util/copyrights b/util/copyrights index 6173b1f1ba..765e2a99cb 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3479,7 +3479,7 @@ ./lib/dns/pkcs11rsa_link.c C 2014,2015,2016,2017 ./lib/dns/portlist.c C 2003,2004,2005,2006,2007,2014,2016 ./lib/dns/private.c C 2009,2011,2012,2015,2016,2017 -./lib/dns/rbt.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/rbt.c C 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/rbtdb.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/rbtdb.h C 1999,2000,2001,2004,2005,2007,2011,2012,2016 ./lib/dns/rbtdb64.c C 1999,2000,2001,2004,2005,2007,2016 From eaddb0c6867a585781dbdbc4b2f47a54fe8b8bf2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:02:14 +1100 Subject: [PATCH 32/74] use %u instead of %d --- lib/dns/rdata/generic/loc_29.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/rdata/generic/loc_29.c b/lib/dns/rdata/generic/loc_29.c index e80d7bcc40..6e32bc0858 100644 --- a/lib/dns/rdata/generic/loc_29.c +++ b/lib/dns/rdata/generic/loc_29.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2005, 2007, 2009, 2015-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2005, 2007, 2009, 2015-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -552,7 +552,7 @@ totext_loc(ARGS_TOTEXT) { } snprintf(buf, sizeof(buf), - "%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s", + "%d %d %d.%03d %s %d %d %d.%03d %s %s%lu.%02lum %s %s %s", d1, m1, s1, fs1, north ? "N" : "S", d2, m2, s2, fs2, east ? "E" : "W", below ? "-" : "", altitude/100, altitude % 100, diff --git a/util/copyrights b/util/copyrights index 765e2a99cb..fe7a514aca 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3538,7 +3538,7 @@ ./lib/dns/rdata/generic/l32_105.h C 2013,2016 ./lib/dns/rdata/generic/l64_106.c C 2013,2014,2015,2016,2017 ./lib/dns/rdata/generic/l64_106.h C 2013,2016 -./lib/dns/rdata/generic/loc_29.c C 1999,2000,2001,2002,2003,2004,2005,2007,2009,2015,2016,2017 +./lib/dns/rdata/generic/loc_29.c C 1999,2000,2001,2002,2003,2004,2005,2007,2009,2015,2016,2017,2018 ./lib/dns/rdata/generic/loc_29.h C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/rdata/generic/lp_107.c C 2013,2015,2016,2017 ./lib/dns/rdata/generic/lp_107.h C 2013,2016 From 0f8b0dc5d47515e3572826fd583731cd7777f342 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:03:05 +1100 Subject: [PATCH 33/74] use %u instead of %d --- lib/dns/resolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 32bd83f6cf..c0f254b129 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -11101,7 +11101,7 @@ dns_resolver_dumpfetches(dns_resolver_t *resolver, fc = ISC_LIST_NEXT(fc, link)) { dns_name_print(fc->domain, fp); - fprintf(fp, ": %d active (%d spilled, %d allowed)\n", + fprintf(fp, ": %u active (%u spilled, %u allowed)\n", fc->count, fc->dropped, fc->allowed); } UNLOCK(&resolver->dbuckets[i].lock); From 9520cf855990d76127858670fbc347008921309c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:14:06 +1100 Subject: [PATCH 34/74] unsigned constants --- lib/dns/sdb.c | 10 +++++----- util/copyrights | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c index 456a54bf9f..f415bad2b8 100644 --- a/lib/dns/sdb.c +++ b/lib/dns/sdb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2003-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2003-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -104,10 +104,10 @@ typedef struct sdb_rdatasetiter { #define VALID_SDBNODE(sdbn) VALID_SDBLOOKUP(sdbn) /* These values are taken from RFC1537 */ -#define SDB_DEFAULT_REFRESH (60 * 60 * 8) -#define SDB_DEFAULT_RETRY (60 * 60 * 2) -#define SDB_DEFAULT_EXPIRE (60 * 60 * 24 * 7) -#define SDB_DEFAULT_MINIMUM (60 * 60 * 24) +#define SDB_DEFAULT_REFRESH 28800U /* 8 hours */ +#define SDB_DEFAULT_RETRY 7200U /* 2 hours */ +#define SDB_DEFAULT_EXPIRE 604800U /* 7 days */ +#define SDB_DEFAULT_MINIMUM 86400U /* 1 day */ /* This is a reasonable value */ #define SDB_DEFAULT_TTL (60 * 60 * 24) diff --git a/util/copyrights b/util/copyrights index fe7a514aca..060e559110 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3656,7 +3656,7 @@ ./lib/dns/rpz.c C 2011,2012,2013,2014,2015,2016,2017 ./lib/dns/rriterator.c C 2009,2011,2012,2015,2016 ./lib/dns/rrl.c C 2012,2013,2014,2015,2016,2017 -./lib/dns/sdb.c C 2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/sdb.c C 2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/sdlz.c C.PORTION 1999,2000,2001,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/soa.c C 2000,2001,2004,2005,2007,2009,2016 ./lib/dns/spnego.asn1 X 2006 From dc3951c8002cca207f784ad770c91be6c84f708c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:16:19 +1100 Subject: [PATCH 35/74] unsigned constants --- lib/dns/sdlz.c | 12 +++++------- util/copyrights | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 6d0183320c..42cfbbda5b 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -1,5 +1,5 @@ /* - * Portions Copyright (C) 1999-2001, 2005-2017 Internet Systems Consortium, Inc. ("ISC") + * Portions Copyright (C) 1999-2001, 2005-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -41,8 +41,6 @@ * USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - /*! \file */ #include @@ -149,10 +147,10 @@ typedef struct sdlz_rdatasetiter { #define VALID_SDLZNODE(sdlzn) VALID_SDLZLOOKUP(sdlzn) /* These values are taken from RFC 1537 */ -#define SDLZ_DEFAULT_REFRESH (60 * 60 * 8) -#define SDLZ_DEFAULT_RETRY (60 * 60 * 2) -#define SDLZ_DEFAULT_EXPIRE (60 * 60 * 24 * 7) -#define SDLZ_DEFAULT_MINIMUM (60 * 60 * 24) +#define SDLZ_DEFAULT_REFRESH 28800U /* 8 hours */ +#define SDLZ_DEFAULT_RETRY 7200U /* 2 hours */ +#define SDLZ_DEFAULT_EXPIRE 604800U /* 7 days */ +#define SDLZ_DEFAULT_MINIMUM 86400U /* 1 day */ /* This is a reasonable value */ #define SDLZ_DEFAULT_TTL (60 * 60 * 24) diff --git a/util/copyrights b/util/copyrights index 060e559110..5fb7cd83b4 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3657,7 +3657,7 @@ ./lib/dns/rriterator.c C 2009,2011,2012,2015,2016 ./lib/dns/rrl.c C 2012,2013,2014,2015,2016,2017 ./lib/dns/sdb.c C 2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 -./lib/dns/sdlz.c C.PORTION 1999,2000,2001,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/sdlz.c C.PORTION 1999,2000,2001,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/soa.c C 2000,2001,2004,2005,2007,2009,2016 ./lib/dns/spnego.asn1 X 2006 ./lib/dns/spnego.c C 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 From 75a291e541f14e1ae089c93d60071353134de338 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:24:11 +1100 Subject: [PATCH 36/74] use %u instead of %d --- lib/dns/tcpmsg.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/tcpmsg.c b/lib/dns/tcpmsg.c index ec658923d0..3e30c106ae 100644 --- a/lib/dns/tcpmsg.c +++ b/lib/dns/tcpmsg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001, 2004-2007, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2004-2007, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -113,7 +113,7 @@ recv_message(isc_task_t *task, isc_event_t *ev_in) { tcpmsg->result = ISC_R_SUCCESS; isc_buffer_add(&tcpmsg->buffer, ev->n); - XDEBUG(("Received %d bytes (of %d)\n", ev->n, tcpmsg->size)); + XDEBUG(("Received %u bytes (of %d)\n", ev->n, tcpmsg->size)); send_and_free: isc_task_send(tcpmsg->task, &dev); diff --git a/util/copyrights b/util/copyrights index 5fb7cd83b4..07f2030fc3 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3667,7 +3667,7 @@ ./lib/dns/ssu.c C 2000,2001,2003,2004,2005,2006,2007,2008,2010,2011,2013,2014,2016,2017,2018 ./lib/dns/ssu_external.c C 2011,2012,2013,2016,2017 ./lib/dns/stats.c C 2000,2001,2004,2005,2007,2008,2009,2012,2016 -./lib/dns/tcpmsg.c C 1999,2000,2001,2004,2005,2006,2007,2015,2016 +./lib/dns/tcpmsg.c C 1999,2000,2001,2004,2005,2006,2007,2015,2016,2018 ./lib/dns/tests/Atffile X 2011,2017 ./lib/dns/tests/Kdh.+002+18602.key X 2014 ./lib/dns/tests/Krsa.+005+29235.key X 2016 From 34a4d241c657c74feb64c3b9f81fad6a1d3ea0e8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 00:41:13 +1100 Subject: [PATCH 37/74] shift unsigned (~0U) rather than signed (~0) contant --- lib/isc/unix/ifiter_ioctl.c | 7 ++++--- util/copyrights | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index 5648811ab7..cd1becd5c3 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2009, 2014-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2009, 2014-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -555,7 +555,8 @@ internal_current4(isc_interfaceiter_t *iter) { bits = 8 - prefixlen; prefixlen = 0; } - iter->current.netmask.type.in6.s6_addr[i] = (~0 << bits) & 0xff; + iter->current.netmask.type.in6.s6_addr[i] = + (~0U << bits) & 0xff; } return (ISC_R_SUCCESS); @@ -749,7 +750,7 @@ internal_current6(isc_interfaceiter_t *iter) { bits = lifreq.lifr_addrlen - i; bits = (bits < 8) ? (8 - bits) : 0; iter->current.netmask.type.in6.s6_addr[i / 8] = - (~0 << bits) & 0xff; + (~0U << bits) & 0xff; } return (ISC_R_SUCCESS); diff --git a/util/copyrights b/util/copyrights index 07f2030fc3..67c4e70648 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4077,7 +4077,7 @@ ./lib/isc/unix/file.c C 2000,2001,2002,2004,2005,2007,2009,2011,2012,2013,2014,2015,2016,2017 ./lib/isc/unix/fsaccess.c C 2000,2001,2004,2005,2006,2007,2016 ./lib/isc/unix/ifiter_getifaddrs.c C 2003,2004,2005,2007,2008,2009,2014,2016 -./lib/isc/unix/ifiter_ioctl.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2014,2015,2016,2017 +./lib/isc/unix/ifiter_ioctl.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2014,2015,2016,2017,2018 ./lib/isc/unix/ifiter_sysctl.c C 1999,2000,2001,2002,2003,2004,2005,2007,2014,2015,2016 ./lib/isc/unix/include/Makefile.in MAKE 1998,1999,2000,2001,2004,2007,2012,2014,2016 ./lib/isc/unix/include/isc/Makefile.in MAKE 1998,1999,2000,2001,2004,2007,2012,2013,2014,2015,2016 From 64bc122d11cc34cc20be0d74a36f969326afd12e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 11:41:13 +1100 Subject: [PATCH 38/74] use %u instead of %d --- bin/named/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/named/server.c b/bin/named/server.c index 985925a84b..3c17063a00 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -11216,7 +11216,7 @@ named_server_status(named_server_t *server, isc_buffer_t **text) { zonecount, automatic); CHECK(putstr(text, line)); - snprintf(line, sizeof(line), "debug level: %d\n", named_g_debuglevel); + snprintf(line, sizeof(line), "debug level: %u\n", named_g_debuglevel); CHECK(putstr(text, line)); snprintf(line, sizeof(line), "xfers running: %u\n", xferrunning); From 4955c45c949fb21b6f741010ab34985e16ff0178 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 11:52:33 +1100 Subject: [PATCH 39/74] use %u instead of %d --- bin/tools/dnstap-read.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tools/dnstap-read.c b/bin/tools/dnstap-read.c index c9d30ab7df..756b22b38b 100644 --- a/bin/tools/dnstap-read.c +++ b/bin/tools/dnstap-read.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -223,7 +223,7 @@ print_yaml(dns_dtdata_t *dt) { } if (dt->msgdata.base != NULL) { - printf(" message_size: %zdb\n", (size_t) dt->msgdata.length); + printf(" message_size: %zub\n", (size_t) dt->msgdata.length); } else printf(" message_size: 0b\n"); diff --git a/util/copyrights b/util/copyrights index 67c4e70648..43189359ac 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2610,7 +2610,7 @@ ./bin/tools/arpaname.docbook SGML 2009,2014,2015,2016 ./bin/tools/arpaname.html HTML DOCBOOK ./bin/tools/dnstap-read.1 MAN DOCBOOK -./bin/tools/dnstap-read.c C 2015,2016,2017 +./bin/tools/dnstap-read.c C 2015,2016,2017,2018 ./bin/tools/dnstap-read.docbook SGML 2015,2016,2017 ./bin/tools/dnstap-read.html HTML DOCBOOK ./bin/tools/genrandom.8 MAN DOCBOOK From b513bbe9ff21fe0f7cbc147efebfae293a2e292f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:04:33 +1100 Subject: [PATCH 40/74] use %u instead of %d --- lib/dns/dnstap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/dnstap.c b/lib/dns/dnstap.c index 9c58a79ee8..9022762544 100644 --- a/lib/dns/dnstap.c +++ b/lib/dns/dnstap.c @@ -1247,7 +1247,7 @@ dns_dt_datatotext(dns_dtdata_t *d, isc_buffer_t **dest) { /* Message size */ if (d->msgdata.base != NULL) { - snprintf(buf, sizeof(buf), "%zdb ", (size_t) d->msgdata.length); + snprintf(buf, sizeof(buf), "%zub ", (size_t) d->msgdata.length); CHECK(putstr(dest, buf)); } else CHECK(putstr(dest, "0b ")); From c23eef5ff1419ba25613def979acf4b04f421639 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:08:52 +1100 Subject: [PATCH 41/74] make both arguments of & unsigned --- lib/dns/byaddr.c | 10 +++++----- util/copyrights | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/dns/byaddr.c b/lib/dns/byaddr.c index 19253e7b28..22ba897d3f 100644 --- a/lib/dns/byaddr.c +++ b/lib/dns/byaddr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2005, 2007, 2009, 2013, 2016, 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000-2005, 2007, 2009, 2013, 2016-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -75,10 +75,10 @@ dns_byaddr_createptrname2(const isc_netaddr_t *address, unsigned int options, if (address->family == AF_INET) { (void)snprintf(textname, sizeof(textname), "%u.%u.%u.%u.in-addr.arpa.", - (bytes[3] & 0xff), - (bytes[2] & 0xff), - (bytes[1] & 0xff), - (bytes[0] & 0xff)); + (bytes[3] & 0xffU), + (bytes[2] & 0xffU), + (bytes[1] & 0xffU), + (bytes[0] & 0xffU)); } else if (address->family == AF_INET6) { size_t remaining; diff --git a/util/copyrights b/util/copyrights index 43189359ac..35ca678838 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3301,7 +3301,7 @@ ./lib/dns/adb.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/api X 1999,2000,2001,2006,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/badcache.c C 2014,2015,2016 -./lib/dns/byaddr.c C 2000,2001,2002,2003,2004,2005,2007,2009,2013,2016,2017 +./lib/dns/byaddr.c C 2000,2001,2002,2003,2004,2005,2007,2009,2013,2016,2017,2018 ./lib/dns/cache.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/callbacks.c C 1999,2000,2001,2004,2005,2007,2011,2012,2015,2016 ./lib/dns/catz.c C 2016,2017,2018 From 4745daafe0dbfe8d90300e6e31a84bf17b733800 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:11:17 +1100 Subject: [PATCH 42/74] use %u instead of %d --- bin/tests/dst/dst_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/dst/dst_test.c b/bin/tests/dst/dst_test.c index 7fbfc24101..d499e986a5 100644 --- a/bin/tests/dst/dst_test.c +++ b/bin/tests/dst/dst_test.c @@ -60,13 +60,13 @@ use(dst_key_t *key, isc_mem_t *mctx) { } ret = dst_context_adddata(ctx, &datareg); if (ret != ISC_R_SUCCESS) { - printf("adddata(%d) returned: %s\n", dst_key_alg(key), + printf("adddata(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); dst_context_destroy(&ctx); return; } ret = dst_context_sign(ctx, &sigbuf); - printf("sign(%d) returned: %s\n", dst_key_alg(key), + printf("sign(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); dst_context_destroy(&ctx); @@ -75,13 +75,13 @@ use(dst_key_t *key, isc_mem_t *mctx) { ret = dst_context_create3(key, mctx, DNS_LOGCATEGORY_GENERAL, ISC_FALSE, &ctx); if (ret != ISC_R_SUCCESS) { - printf("contextcreate(%d) returned: %s\n", dst_key_alg(key), + printf("contextcreate(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); return; } ret = dst_context_adddata(ctx, &datareg); if (ret != ISC_R_SUCCESS) { - printf("adddata(%d) returned: %s\n", dst_key_alg(key), + printf("adddata(%u) returned: %s\n", dst_key_alg(key), isc_result_totext(ret)); dst_context_destroy(&ctx); return; From 78ad353491db2420d713c4e6a96b3b17266131d4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:24:33 +1100 Subject: [PATCH 43/74] preserve unsigned property --- lib/dns/rdata/in_1/dhcid_49.c | 6 +++--- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dns/rdata/in_1/dhcid_49.c b/lib/dns/rdata/in_1/dhcid_49.c index c0d14a104c..ab72b38017 100644 --- a/lib/dns/rdata/in_1/dhcid_49.c +++ b/lib/dns/rdata/in_1/dhcid_49.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2009, 2011, 2012, 2015-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2006, 2007, 2009, 2011, 2012, 2015-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -54,8 +54,8 @@ totext_in_dhcid(ARGS_TOTEXT) { RETERR(str_totext(/* ( */ " )", target)); if (rdata->length > 2) { n = snprintf(buf, sizeof(buf), " ; %u %u %u", - sr2.base[0] * 256 + sr2.base[1], - sr2.base[2], rdata->length - 3); + sr2.base[0] * 256U + sr2.base[1], + sr2.base[2], rdata->length - 3U); INSIST(n < sizeof(buf)); RETERR(str_totext(buf, target)); } diff --git a/util/copyrights b/util/copyrights index 35ca678838..1f28765d7c 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3628,7 +3628,7 @@ ./lib/dns/rdata/in_1/aaaa_28.h C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/rdata/in_1/apl_42.c C 2002,2004,2005,2007,2008,2009,2014,2015,2016 ./lib/dns/rdata/in_1/apl_42.h C 2002,2004,2005,2007,2016 -./lib/dns/rdata/in_1/dhcid_49.c C 2006,2007,2009,2011,2012,2015,2016,2017 +./lib/dns/rdata/in_1/dhcid_49.c C 2006,2007,2009,2011,2012,2015,2016,2017,2018 ./lib/dns/rdata/in_1/dhcid_49.h C 2006,2007,2016 ./lib/dns/rdata/in_1/kx_36.c C 1999,2000,2001,2003,2004,2005,2007,2009,2015,2016,2017 ./lib/dns/rdata/in_1/kx_36.h C 1999,2000,2001,2004,2005,2007,2016 From 6bd6bd6d629b23f7f1834ae7fddbe898534c696c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:24:56 +1100 Subject: [PATCH 44/74] cast to unsigned --- lib/dns/message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/message.c b/lib/dns/message.c index 95d9382947..ef71fa16eb 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -46,7 +46,7 @@ hexdump(const char *msg, const char *msg2, void *base, size_t len) { p = base; cnt = 0; - printf("*** %s [%s] (%u bytes @ %p)\n", msg, msg2, len, base); + printf("*** %s [%s] (%u bytes @ %p)\n", msg, msg2, (unsigned)len, base); while (cnt < len) { if (cnt % 16 == 0) From b5167607efcfe6e0cdc6a0d0f47ed2edb927f874 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:36:03 +1100 Subject: [PATCH 45/74] make declaration and use of setnocookie fully conditional --- lib/dns/resolver.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index c0f254b129..99831c237a 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -9348,9 +9348,10 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) { } } else if (fctx->rmessage->rcode == dns_rcode_badvers) { unsigned int version; - isc_boolean_t setnocookie = ISC_FALSE; #if DNS_EDNS_VERSION > 0 unsigned int flags, mask; +#else + isc_boolean_t setnocookie = ISC_FALSE; #endif /* @@ -9362,8 +9363,10 @@ rctx_badserver(respctx_t *rctx, isc_result_t result) { */ if (dns_adb_getcookie(fctx->adb, query->addrinfo, cookie, sizeof(cookie)) == 0U) { +#if DNS_EDNS_VERSION <= 0 if (!NOCOOKIE(query->addrinfo)) setnocookie = ISC_TRUE; +#endif dns_adb_changeflags(fctx->adb, query->addrinfo, FCTX_ADDRINFO_NOCOOKIE, FCTX_ADDRINFO_NOCOOKIE); From 97d4a1eaf5304146e95291812f652e86decc4e8b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 12:38:22 +1100 Subject: [PATCH 46/74] use %u and preserve unsigned property --- lib/dns/rpz.c | 14 +++++++------- util/copyrights | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index ea3e014fd4..3ac83bfe12 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -703,12 +703,12 @@ ip2name(const dns_rpz_cidr_key_t *tgt_ip, dns_rpz_prefix_t tgt_prefix, int i, n, len; if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) { - len = snprintf(str, sizeof(str), "%d.%d.%d.%d.%d", - tgt_prefix - 96, - tgt_ip->w[3] & 0xff, - (tgt_ip->w[3]>>8) & 0xff, - (tgt_ip->w[3]>>16) & 0xff, - (tgt_ip->w[3]>>24) & 0xff); + len = snprintf(str, sizeof(str), "%u.%u.%u.%u.%u", + tgt_prefix - 96U, + tgt_ip->w[3] & 0xffU, + (tgt_ip->w[3]>>8) & 0xffU, + (tgt_ip->w[3]>>16) & 0xffU, + (tgt_ip->w[3]>>24) & 0xffU); if (len < 0 || len > (int)sizeof(str)) { return (ISC_R_FAILURE); } diff --git a/util/copyrights b/util/copyrights index 1f28765d7c..d2b166166a 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3653,7 +3653,7 @@ ./lib/dns/resolver.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/result.c C 1998,1999,2000,2001,2002,2003,2004,2005,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/rootns.c C 1999,2000,2001,2002,2004,2005,2007,2008,2010,2012,2013,2014,2015,2016,2017 -./lib/dns/rpz.c C 2011,2012,2013,2014,2015,2016,2017 +./lib/dns/rpz.c C 2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/rriterator.c C 2009,2011,2012,2015,2016 ./lib/dns/rrl.c C 2012,2013,2014,2015,2016,2017 ./lib/dns/sdb.c C 2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 From 500248b6c1059a0bec717338aae2978f1f7866ce Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:11:25 +1100 Subject: [PATCH 47/74] simplify expression --- lib/dns/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/update.c b/lib/dns/update.c index b6d794b23f..08a6575d19 100644 --- a/lib/dns/update.c +++ b/lib/dns/update.c @@ -1389,7 +1389,7 @@ dns_update_signaturesinc(dns_update_log_t *log, dns_zone_t *zone, dns_db_t *db, unsigned int sigs = 0; unsigned int maxsigs = dns_zone_getsignatures(zone); - if (statep == NULL || (statep != NULL && *statep == NULL)) { + if (statep == NULL || *statep == NULL) { if (statep == NULL) { state = &mystate; } else { From e632696a6df1c0815847b9b628a639b8c9fee7b8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:20:59 +1100 Subject: [PATCH 48/74] case to unsigned; reorder expression --- lib/isc/log.c | 13 +++++++------ util/copyrights | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/isc/log.c b/lib/isc/log.c index 296f596318..c92b19f9d0 100644 --- a/lib/isc/log.c +++ b/lib/isc/log.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2007, 2009, 2011-2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2007, 2009, 2011-2014, 2016-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1281,8 +1281,8 @@ remove_old_tsversions(isc_logfile_t *file, int versions) { &digit_end, 10); if (*digit_end == '\0') { int i = 0; - while (version < to_keep[i] && - i < versions) + while (i < versions && + version < to_keep[i]) { i++; } @@ -1353,7 +1353,7 @@ roll_increment(isc_logfile_t *file) { */ for (greatest = 0; greatest < INT_MAX; greatest++) { n = snprintf(current, sizeof(current), - "%s.%u", path, greatest) ; + "%s.%u", path, (unsigned)greatest) ; if (n >= (int)sizeof(current) || n < 0 || !isc_file_exists(current)) { @@ -1380,13 +1380,14 @@ roll_increment(isc_logfile_t *file) { for (i = greatest; i > 0; i--) { result = ISC_R_SUCCESS; - n = snprintf(current, sizeof(current), "%s.%u", path, i - 1); + n = snprintf(current, sizeof(current), "%s.%u", path, + (unsigned)(i - 1)); if (n >= (int)sizeof(current) || n < 0) { result = ISC_R_NOSPACE; } if (result == ISC_R_SUCCESS) { n = snprintf(newpath, sizeof(newpath), "%s.%u", - path, i); + path, (unsigned)i); if (n >= (int)sizeof(newpath) || n < 0) { result = ISC_R_NOSPACE; } diff --git a/util/copyrights b/util/copyrights index d2b166166a..37ede234c9 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3960,7 +3960,7 @@ ./lib/isc/lex.c C 1998,1999,2000,2001,2002,2003,2004,2005,2007,2013,2014,2015,2016,2017 ./lib/isc/lfsr.c C 1999,2000,2001,2002,2004,2005,2007,2016 ./lib/isc/lib.c C 1999,2000,2001,2004,2005,2007,2009,2013,2014,2015,2016 -./lib/isc/log.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2009,2011,2012,2013,2014,2016,2017 +./lib/isc/log.c C 1999,2000,2001,2002,2003,2004,2005,2006,2007,2009,2011,2012,2013,2014,2016,2017,2018 ./lib/isc/md5.c C 2000,2001,2004,2005,2007,2009,2014,2015,2016,2017,2018 ./lib/isc/mem.c C 1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018 ./lib/isc/mips/Makefile.in MAKE 2007,2012,2016 From 5bc9ede0928c2aa320b404ad5a2aa122271c594a Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:23:11 +1100 Subject: [PATCH 49/74] use %u instead of %d --- lib/isc/mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/isc/mem.c b/lib/isc/mem.c index 8e10d16ad9..da1769c091 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -2274,7 +2274,7 @@ print_contexts(FILE *file) { ctx != NULL; ctx = ISC_LIST_NEXT(ctx, link)) { - fprintf(file, "context: %p (%s): %d references\n", + fprintf(file, "context: %p (%s): %u references\n", ctx, ctx->name[0] == 0 ? "" : ctx->name, ctx->references); From 1cdb19eaae64042a762779dbbe8977c6c8fa5bee Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:26:09 +1100 Subject: [PATCH 50/74] use %u instead of %d --- lib/isc/task.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/task.c b/lib/isc/task.c index 3b73e595ed..2fe636972f 100644 --- a/lib/isc/task.c +++ b/lib/isc/task.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1448,7 +1448,7 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers, &manager->threads[manager->workers]) == ISC_R_SUCCESS) { char name[16]; /* thread name limit on Linux */ - snprintf(name, sizeof(name), "isc-worker%04d", i); + snprintf(name, sizeof(name), "isc-worker%04u", i); isc_thread_setname(manager->threads[manager->workers], name); manager->workers++; diff --git a/util/copyrights b/util/copyrights index 37ede234c9..d889bb4cf3 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4029,7 +4029,7 @@ ./lib/isc/string.c C 1999,2000,2001,2003,2004,2005,2006,2007,2011,2012,2014,2015,2016 ./lib/isc/strtoul.c C 2003,2004,2005,2007,2014,2016 ./lib/isc/symtab.c C 1996,1997,1998,1999,2000,2001,2004,2005,2007,2011,2012,2013,2016 -./lib/isc/task.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/isc/task.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/isc/taskpool.c C 1999,2000,2001,2004,2005,2007,2011,2012,2013,2016 ./lib/isc/tests/Atffile X 2011,2017 ./lib/isc/tests/Kyuafile X 2017 From c7e848ce5499d7eb74c9a4bdb8d63fca8d14d9a3 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:27:03 +1100 Subject: [PATCH 51/74] use %u instead of %d --- lib/isc/win32/interfaceiter.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/win32/interfaceiter.c b/lib/isc/win32/interfaceiter.c index 89c31e3746..8213eba0d4 100644 --- a/lib/isc/win32/interfaceiter.c +++ b/lib/isc/win32/interfaceiter.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001, 2004, 2007-2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2004, 2007-2009, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -388,7 +388,7 @@ internal_current6(isc_interfaceiter_t *iter) { iter->current.flags = INTERFACE_F_UP; snprintf(iter->current.name, sizeof(iter->current.name), - "TCP/IPv6 Interface %d", iter->pos6 + 1); + "TCP/IPv6 Interface %u", iter->pos6 + 1); for (i = 0; i < 16; i++) iter->current.netmask.type.in6.s6_addr[i] = 0xff; diff --git a/util/copyrights b/util/copyrights index d889bb4cf3..8253615b7c 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4148,7 +4148,7 @@ ./lib/isc/win32/include/isc/win32os.h C 2002,2004,2007,2009,2015,2016 ./lib/isc/win32/include/pkcs11/Makefile.in MAKE 2014,2016 ./lib/isc/win32/include/pkcs11/cryptoki.h X 2014 -./lib/isc/win32/interfaceiter.c C 1999,2000,2001,2004,2007,2008,2009,2013,2014,2015,2016 +./lib/isc/win32/interfaceiter.c C 1999,2000,2001,2004,2007,2008,2009,2013,2014,2015,2016,2018 ./lib/isc/win32/ipv6.c C 1999,2000,2001,2004,2007,2016 ./lib/isc/win32/keyboard.c C 2000,2001,2004,2007,2016 ./lib/isc/win32/libgen.h C 2009,2016 From 54275e8f5cd348c008cd6551d5ae08630d1b7c5a Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:29:22 +1100 Subject: [PATCH 52/74] use %u instead of %d --- lib/isc/win32/socket.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/isc/win32/socket.c b/lib/isc/win32/socket.c index ffb7dadf8f..0fe6af2aa8 100644 --- a/lib/isc/win32/socket.c +++ b/lib/isc/win32/socket.c @@ -402,12 +402,12 @@ sock_dump(isc_socket_t *sock) { printf("\n\t\tSock Dump\n"); printf("\t\tfd: %Iu\n", sock->fd); - printf("\t\treferences: %d\n", sock->references); - printf("\t\tpending_accept: %d\n", sock->pending_accept); - printf("\t\tconnecting: %d\n", sock->pending_connect); - printf("\t\tconnected: %d\n", sock->connected); - printf("\t\tbound: %d\n", sock->bound); - printf("\t\tpending_iocp: %d\n", sock->pending_iocp); + printf("\t\treferences: %u\n", sock->references); + printf("\t\tpending_accept: %u\n", sock->pending_accept); + printf("\t\tconnecting: %u\n", sock->pending_connect); + printf("\t\tconnected: %u\n", sock->connected); + printf("\t\tbound: %u\n", sock->bound); + printf("\t\tpending_iocp: %u\n", sock->pending_iocp); printf("\t\tsocket type: %d\n", sock->type); printf("\n\t\tSock Recv List\n"); From b4927007595deb30793cd7e5da74df366e4782a9 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 13:43:13 +1100 Subject: [PATCH 53/74] use %u instead of %d --- lib/ns/client.c | 2 +- lib/ns/query.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ns/client.c b/lib/ns/client.c index 1d3b62a5eb..3b7240b6bd 100644 --- a/lib/ns/client.c +++ b/lib/ns/client.c @@ -3974,7 +3974,7 @@ ns_client_dumprecursing(FILE *f, ns_clientmgr_t *manager) { } UNLOCK(&client->query.fetchlock); fprintf(f, "; client %s%s%s: id %u '%s/%s/%s'%s%s " - "requesttime %d\n", peerbuf, sep, name, + "requesttime %u\n", peerbuf, sep, name, client->message->id, namebuf, typebuf, classbuf, origfor, original, isc_time_seconds(&client->requesttime)); diff --git a/lib/ns/query.c b/lib/ns/query.c index d1b2fcb6eb..e4d56917a9 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -5072,7 +5072,7 @@ query_trace(query_ctx_t *qctx) { snprintf(qbuf, sizeof(qbuf), ""); snprintf(mbuf, sizeof(mbuf) - 1, - "client attr:0x%x, query attr:0x%X, restarts:%d, " + "client attr:0x%x, query attr:0x%X, restarts:%u, " "origqname:%s, timer:%d, authdb:%d, referral:%d", qctx->client->attributes, qctx->client->query.attributes, From 1eb1eaac94f10c0b390b1b7f394cb5f583be0ef4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:20:16 +1100 Subject: [PATCH 54/74] use %u instead of %d --- lib/samples/nsprobe.c | 14 +++++++------- util/copyrights | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/samples/nsprobe.c b/lib/samples/nsprobe.c index c6366faa21..cff684c46e 100644 --- a/lib/samples/nsprobe.c +++ b/lib/samples/nsprobe.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -627,7 +627,7 @@ request_done(isc_task_t *task, isc_event_t *event) { } else if (rev->result == ISC_R_TIMEDOUT) *resultp = timedout; else { - fprintf(stderr, "unexpected result: %d (domain=%s, server=", + fprintf(stderr, "unexpected result: %u (domain=%s, server=", rev->result, trans->domain); print_address(stderr, &server->address); fputc('\n', stderr); @@ -1060,14 +1060,14 @@ main(int argc, char *argv[]) { isc_lib_register(); result = dns_lib_init(); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_lib_init failed: %d\n", result); + fprintf(stderr, "dns_lib_init failed: %u\n", result); exit(1); } result = ctxs_init(&mctx, &actx, &taskmgr, &socketmgr, &timermgr); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "ctx create failed: %d\n", result); + fprintf(stderr, "ctx create failed: %u\n", result); exit(1); } @@ -1076,7 +1076,7 @@ main(int argc, char *argv[]) { result = dns_client_createx(mctx, actx, taskmgr, socketmgr, timermgr, 0, &client); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_client_createx failed: %d\n", result); + fprintf(stderr, "dns_client_createx failed: %u\n", result); exit(1); } @@ -1106,7 +1106,7 @@ main(int argc, char *argv[]) { result = dns_client_setservers(client, dns_rdataclass_in, NULL, &servers); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "failed to set server: %d\n", result); + fprintf(stderr, "failed to set server: %u\n", result); exit(1); } @@ -1114,7 +1114,7 @@ main(int argc, char *argv[]) { probe_task = NULL; result = isc_task_create(taskmgr, 0, &probe_task); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "failed to create task: %d\n", result); + fprintf(stderr, "failed to create task: %u\n", result); exit(1); } diff --git a/util/copyrights b/util/copyrights index 8253615b7c..16ed7d111d 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4300,7 +4300,7 @@ ./lib/samples/.gitignore X 2013,2014 ./lib/samples/Makefile-postinstall.in MAKE 2009,2012,2013,2014,2016,2017 ./lib/samples/Makefile.in MAKE 2009,2012,2013,2014,2015,2016,2017 -./lib/samples/nsprobe.c C 2009,2010,2011,2012,2013,2014,2015,2016 +./lib/samples/nsprobe.c C 2009,2010,2011,2012,2013,2014,2015,2016,2018 ./lib/samples/resolve.c C 2009,2012,2013,2014,2015,2016,2017 ./lib/samples/rootkey.sh SH 2013,2016 ./lib/samples/sample-async.c C 2009,2013,2014,2015,2016 From fc38731c857e113b1742af4e2b6655a6e5e82479 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:21:42 +1100 Subject: [PATCH 55/74] use %u instead of %d --- lib/samples/resolve.c | 16 ++++++++-------- util/copyrights | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/samples/resolve.c b/lib/samples/resolve.c index 13c431a71a..f0b959dd3f 100644 --- a/lib/samples/resolve.c +++ b/lib/samples/resolve.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2012-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2012-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -214,7 +214,7 @@ addserver(dns_client_t *client, const char *addrstr, const char *port, name = dns_fixedname_name(&fname); result = dns_name_fromtext(name, &b, dns_rootname, 0, NULL); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "failed to convert qname: %d\n", + fprintf(stderr, "failed to convert qname: %u\n", result); exit(1); } @@ -223,7 +223,7 @@ addserver(dns_client_t *client, const char *addrstr, const char *port, result = dns_client_setservers(client, dns_rdataclass_in, name, &servers); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "set server failed: %d\n", result); + fprintf(stderr, "set server failed: %u\n", result); exit(1); } } @@ -363,7 +363,7 @@ main(int argc, char *argv[]) { isc_lib_register(); result = dns_lib_init(); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_lib_init failed: %d\n", result); + fprintf(stderr, "dns_lib_init failed: %u\n", result); exit(1); } @@ -393,7 +393,7 @@ main(int argc, char *argv[]) { result = dns_client_createx2(mctx, actx, taskmgr, socketmgr, timermgr, clientopt, &client, addr4, addr6); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_client_create failed: %d, %s\n", result, + fprintf(stderr, "dns_client_create failed: %u, %s\n", result, isc_result_totext(result)); exit(1); } @@ -405,7 +405,7 @@ main(int argc, char *argv[]) { result = irs_resconf_load(mctx, "/etc/resolv.conf", &resconf); if (result != ISC_R_SUCCESS && result != ISC_R_FILENOTFOUND) { - fprintf(stderr, "irs_resconf_load failed: %d\n", + fprintf(stderr, "irs_resconf_load failed: %u\n", result); exit(1); } @@ -414,7 +414,7 @@ main(int argc, char *argv[]) { NULL, nameservers); if (result != ISC_R_SUCCESS) { irs_resconf_destroy(&resconf); - fprintf(stderr, "dns_client_setservers failed: %d\n", + fprintf(stderr, "dns_client_setservers failed: %u\n", result); exit(1); } @@ -446,7 +446,7 @@ main(int argc, char *argv[]) { qname = dns_fixedname_name(&qname0); result = dns_name_fromtext(qname, &b, dns_rootname, 0, NULL); if (result != ISC_R_SUCCESS) - fprintf(stderr, "failed to convert qname: %d\n", result); + fprintf(stderr, "failed to convert qname: %u\n", result); /* Perform resolution */ resopt = DNS_CLIENTRESOPT_ALLOWRUN; diff --git a/util/copyrights b/util/copyrights index 16ed7d111d..d84a20d6a7 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4301,7 +4301,7 @@ ./lib/samples/Makefile-postinstall.in MAKE 2009,2012,2013,2014,2016,2017 ./lib/samples/Makefile.in MAKE 2009,2012,2013,2014,2015,2016,2017 ./lib/samples/nsprobe.c C 2009,2010,2011,2012,2013,2014,2015,2016,2018 -./lib/samples/resolve.c C 2009,2012,2013,2014,2015,2016,2017 +./lib/samples/resolve.c C 2009,2012,2013,2014,2015,2016,2017,2018 ./lib/samples/rootkey.sh SH 2013,2016 ./lib/samples/sample-async.c C 2009,2013,2014,2015,2016 ./lib/samples/sample-gai.c C 2009,2012,2013,2014,2015,2016 From 8f8ce953ce9087507b76047fdd1161ca6d1d696f Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:23:15 +1100 Subject: [PATCH 56/74] use %u instead of %d --- lib/samples/sample-async.c | 14 +++++++------- util/copyrights | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/samples/sample-async.c b/lib/samples/sample-async.c index 74f6e4fa29..2028c18a24 100644 --- a/lib/samples/sample-async.c +++ b/lib/samples/sample-async.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -161,7 +161,7 @@ process_answer(isc_task_t *task, isc_event_t *event) { printf("answer[%2d]\n", trans->id); if (rev->result != ISC_R_SUCCESS) - printf(" failed: %d(%s)\n", rev->result, + printf(" failed: %u(%s)\n", rev->result, dns_result_totext(rev->result)); for (name = ISC_LIST_HEAD(rev->answerlist); name != NULL; @@ -323,14 +323,14 @@ main(int argc, char *argv[]) { isc_lib_register(); result = dns_lib_init(); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_lib_init failed: %d\n", result); + fprintf(stderr, "dns_lib_init failed: %u\n", result); exit(1); } result = ctxs_init(&mctx, &query_actx, &taskmgr, &socketmgr, &timermgr); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "ctx create failed: %d\n", result); + fprintf(stderr, "ctx create failed: %u\n", result); exit(1); } @@ -339,7 +339,7 @@ main(int argc, char *argv[]) { result = dns_client_createx(mctx, query_actx, taskmgr, socketmgr, timermgr, 0, &client); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_client_createx failed: %d\n", result); + fprintf(stderr, "dns_client_createx failed: %u\n", result); exit(1); } @@ -357,7 +357,7 @@ main(int argc, char *argv[]) { result = dns_client_setservers(client, dns_rdataclass_in, NULL, &servers); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "set server failed: %d\n", result); + fprintf(stderr, "set server failed: %u\n", result); exit(1); } @@ -365,7 +365,7 @@ main(int argc, char *argv[]) { query_task = NULL; result = isc_task_create(taskmgr, 0, &query_task); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "failed to create task: %d\n", result); + fprintf(stderr, "failed to create task: %u\n", result); exit(1); } diff --git a/util/copyrights b/util/copyrights index d84a20d6a7..e45a165b42 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4303,7 +4303,7 @@ ./lib/samples/nsprobe.c C 2009,2010,2011,2012,2013,2014,2015,2016,2018 ./lib/samples/resolve.c C 2009,2012,2013,2014,2015,2016,2017,2018 ./lib/samples/rootkey.sh SH 2013,2016 -./lib/samples/sample-async.c C 2009,2013,2014,2015,2016 +./lib/samples/sample-async.c C 2009,2013,2014,2015,2016,2018 ./lib/samples/sample-gai.c C 2009,2012,2013,2014,2015,2016 ./lib/samples/sample-request.c C 2009,2012,2013,2014,2015,2016 ./lib/samples/sample-update.c C 2009,2010,2012,2013,2014,2015,2016,2017,2018 From 452829748692455c0b66e002402a43fbaa076ff4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:23:54 +1100 Subject: [PATCH 57/74] use %u instead of %d --- lib/samples/sample-request.c | 8 ++++---- util/copyrights | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/samples/sample-request.c b/lib/samples/sample-request.c index 11cfd0ec9b..b46616c08c 100644 --- a/lib/samples/sample-request.c +++ b/lib/samples/sample-request.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2012-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2012-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -85,7 +85,7 @@ make_querymessage(dns_message_t *message, const char *namestr, qname0 = dns_fixedname_name(&fixedqname); result = dns_name_fromtext(qname0, &b, dns_rootname, 0, NULL); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "failed to convert qname: %d\n", result); + fprintf(stderr, "failed to convert qname: %u\n", result); return (result); } @@ -175,13 +175,13 @@ main(int argc, char *argv[]) { isc_lib_register(); result = dns_lib_init(); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_lib_init failed: %d\n", result); + fprintf(stderr, "dns_lib_init failed: %u\n", result); exit(1); } result = dns_client_create(&client, 0); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_client_create failed: %d\n", result); + fprintf(stderr, "dns_client_create failed: %u\n", result); exit(1); } diff --git a/util/copyrights b/util/copyrights index e45a165b42..361b0952ab 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4305,7 +4305,7 @@ ./lib/samples/rootkey.sh SH 2013,2016 ./lib/samples/sample-async.c C 2009,2013,2014,2015,2016,2018 ./lib/samples/sample-gai.c C 2009,2012,2013,2014,2015,2016 -./lib/samples/sample-request.c C 2009,2012,2013,2014,2015,2016 +./lib/samples/sample-request.c C 2009,2012,2013,2014,2015,2016,2018 ./lib/samples/sample-update.c C 2009,2010,2012,2013,2014,2015,2016,2017,2018 ./lib/samples/win32/async.vcxproj.filters.in X 2014,2015 ./lib/samples/win32/async.vcxproj.in X 2014,2015,2016,2017 From a7eb3b3b76179c1753dab80e02bce80aa4a115f8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:25:37 +1100 Subject: [PATCH 58/74] use %u instead of %d --- lib/samples/sample-update.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/samples/sample-update.c b/lib/samples/sample-update.c index 7be557e2d3..8e303cd19d 100644 --- a/lib/samples/sample-update.c +++ b/lib/samples/sample-update.c @@ -236,7 +236,7 @@ main(int argc, char *argv[]) { isc_lib_register(); result = dns_lib_init(); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_lib_init failed: %d\n", result); + fprintf(stderr, "dns_lib_init failed: %u\n", result); exit(1); } result = isc_mem_create(0, 0, &umctx); @@ -247,7 +247,7 @@ main(int argc, char *argv[]) { result = dns_client_create(&client, 0); if (result != ISC_R_SUCCESS) { - fprintf(stderr, "dns_client_create failed: %d\n", result); + fprintf(stderr, "dns_client_create failed: %u\n", result); exit(1); } @@ -261,7 +261,7 @@ main(int argc, char *argv[]) { zname = dns_fixedname_name(&zname0); result = dns_name_fromtext(zname, &b, dns_rootname, 0, NULL); if (result != ISC_R_SUCCESS) - fprintf(stderr, "failed to convert zone name: %d\n", + fprintf(stderr, "failed to convert zone name: %u\n", result); } From 67eea245f58b6eedc16d4933d3671901e22e097e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:50:36 +1100 Subject: [PATCH 59/74] reorder test to silence cppcheck --- bin/dig/dig.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index b53c44d414..620dde33eb 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1884,8 +1884,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, bargc = 1; input = batchline; bargv[bargc] = next_token(&input, " \t\r\n"); - while ((bargv[bargc] != NULL) && - (bargc < 62)) { + while ((bargc < 62) && (bargv[bargc] != NULL)) { bargc++; bargv[bargc] = next_token(&input, " \t\r\n"); @@ -2084,7 +2083,7 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only, goto next_line; input = batchline; bargv[bargc] = next_token(&input, " \t\r\n"); - while ((bargv[bargc] != NULL) && (bargc < 14)) { + while ((bargc < 14) && (bargv[bargc] != NULL)) { bargc++; bargv[bargc] = next_token(&input, " \t\r\n"); } @@ -2154,7 +2153,7 @@ query_finished(void) { bargc = 1; input = batchline; bargv[bargc] = next_token(&input, " \t\r\n"); - while ((bargv[bargc] != NULL) && (bargc < 14)) { + while ((bargc < 14) && (bargv[bargc] != NULL)) { bargc++; bargv[bargc] = next_token(&input, " \t\r\n"); } From 7e26e5cae7ef4b22b5bc977096c0e2cd64754d9e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 14:56:13 +1100 Subject: [PATCH 60/74] remember the masters count --- bin/named/zoneconf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index df88802766..93d3c5c144 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -1694,6 +1694,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig, ipkl.addrs, ipkl.keys, ipkl.count); + count = ipkl.count; dns_ipkeylist_clear(mctx, &ipkl); RETERR(result); } else From ca6faad2b6900277d55c68811a40e380a30d0258 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 15:00:34 +1100 Subject: [PATCH 61/74] remove event which is only used for sizeof --- bin/tests/tasks/t_tasks.c | 5 ++--- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/tests/tasks/t_tasks.c b/bin/tests/tasks/t_tasks.c index 79831db5b1..f94db4ed69 100644 --- a/bin/tests/tasks/t_tasks.c +++ b/bin/tests/tasks/t_tasks.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2001, 2004, 2005, 2007, 2009, 2011, 2013-2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001, 2004, 2005, 2007, 2009, 2011, 2013-2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -489,7 +489,6 @@ t_tasks2(void) { uintptr_t ntasks; int result; char *p; - isc_event_t *event; unsigned int workers; isc_result_t isc_result; @@ -546,7 +545,7 @@ t_tasks2(void) { } T2_event = isc_event_allocate(T2_mctx, (void *)1, 1, t2_callback, - (void *)ntasks, sizeof(*event)); + (void *)ntasks, sizeof(*T2_event)); if (T2_event == NULL) { t_info("isc_event_allocate failed\n"); return(T_UNRESOLVED); diff --git a/util/copyrights b/util/copyrights index 361b0952ab..b53ae116aa 100644 --- a/util/copyrights +++ b/util/copyrights @@ -2524,7 +2524,7 @@ ./bin/tests/t_api.pl PERL 1999,2000,2001,2004,2007,2012,2016 ./bin/tests/task_test.c C 1998,1999,2000,2001,2004,2007,2013,2014,2015,2016,2018 ./bin/tests/tasks/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2007,2009,2012,2014,2016,2017 -./bin/tests/tasks/t_tasks.c C 1998,1999,2000,2001,2004,2005,2007,2009,2011,2013,2014,2015,2016 +./bin/tests/tasks/t_tasks.c C 1998,1999,2000,2001,2004,2005,2007,2009,2011,2013,2014,2015,2016,2018 ./bin/tests/tasks/win32/t_tasks.vcxproj.filters.in X 2013,2015 ./bin/tests/tasks/win32/t_tasks.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/tasks/win32/t_tasks.vcxproj.user X 2013,2015 From 0b66d4a1c7f03463734220da0f3464331f77960d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 15:53:47 +1100 Subject: [PATCH 62/74] reorder test to silence cppcheck --- bin/tools/mdig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index 8dbc49ab6c..e685a884b5 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -1872,7 +1872,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) continue; input = batchline; bargv[bargc] = next_token(&input, " \t\r\n"); - while ((bargv[bargc] != NULL) && (bargc < 14)) { + while ((bargc < 14) && (bargv[bargc] != NULL)) { bargc++; bargv[bargc] = next_token(&input, " \t\r\n"); } From 99af4e7d52f94458ca2f453b126ff82fa21c82e9 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 15:58:19 +1100 Subject: [PATCH 63/74] add brackets --- bin/tests/tasks/t_tasks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/tasks/t_tasks.c b/bin/tests/tasks/t_tasks.c index f94db4ed69..adebd3a9d9 100644 --- a/bin/tests/tasks/t_tasks.c +++ b/bin/tests/tasks/t_tasks.c @@ -1366,7 +1366,7 @@ t10_event2(isc_task_t *task, isc_event_t *event) { event->ev_sender, (int)event->ev_type, event->ev_tag, - event->ev_attributes & ISC_EVENTATTR_NOPURGE ? + ((event->ev_attributes & ISC_EVENTATTR_NOPURGE) != 0) ? "NP" : "P"); } @@ -1392,7 +1392,7 @@ t10_event2(isc_task_t *task, isc_event_t *event) { if (sender_match && type_match && tag_match) { if (event->ev_attributes & ISC_EVENTATTR_NOPURGE) { t_info("event %p,%d,%p matched but was not purgable\n", - event->ev_sender, (int)event->ev_type, + event->ev_sender, (int)event->ev_type, event->ev_tag); ++T10_eventcnt; } else { From acdecd46367431fa4966be851ae4d327c8fab1c9 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 16:04:01 +1100 Subject: [PATCH 64/74] test for == 0 rather than <= as value is unsigned --- lib/dns/rrl.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dns/rrl.c b/lib/dns/rrl.c index 2c346e9bff..0d4e3e8a00 100644 --- a/lib/dns/rrl.c +++ b/lib/dns/rrl.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -766,7 +766,7 @@ add_log_str(isc_buffer_t *lb, const char *str, unsigned int str_len) { isc_buffer_availableregion(lb, ®ion); if (str_len >= region.length) { - if (region.length <= 0) + if (region.length == 0U) return; str_len = region.length; } diff --git a/util/copyrights b/util/copyrights index b53ae116aa..5d2ddcc5a0 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3655,7 +3655,7 @@ ./lib/dns/rootns.c C 1999,2000,2001,2002,2004,2005,2007,2008,2010,2012,2013,2014,2015,2016,2017 ./lib/dns/rpz.c C 2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/rriterator.c C 2009,2011,2012,2015,2016 -./lib/dns/rrl.c C 2012,2013,2014,2015,2016,2017 +./lib/dns/rrl.c C 2012,2013,2014,2015,2016,2017,2018 ./lib/dns/sdb.c C 2000,2001,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/sdlz.c C.PORTION 1999,2000,2001,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/soa.c C 2000,2001,2004,2005,2007,2009,2016 From 0ec66f5e512302565f6d97592facd57042642b41 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 16:07:01 +1100 Subject: [PATCH 65/74] conditionally declare strbuf --- bin/named/unix/os.c | 4 +++- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index f6e6da30b2..cfabc3a0c1 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2002, 2004-2011, 2013-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2002, 2004-2011, 2013-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -755,7 +755,9 @@ mkdirpath(char *filename, void (*report)(const char *, ...)) { static void setperms(uid_t uid, gid_t gid) { +#if defined(HAVE_SETEGID) || defined(HAVE_SETRESGID) char strbuf[ISC_STRERRORSIZE]; +#endif #if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) gid_t oldgid, tmpg; #endif diff --git a/util/copyrights b/util/copyrights index 5d2ddcc5a0..7f7044d154 100644 --- a/util/copyrights +++ b/util/copyrights @@ -215,7 +215,7 @@ ./bin/named/unix/Makefile.in MAKE 1999,2000,2001,2004,2007,2009,2011,2012,2016 ./bin/named/unix/dlz_dlopen_driver.c C 2011,2012,2013,2014,2016,2017 ./bin/named/unix/include/named/os.h C 1999,2000,2001,2002,2004,2005,2007,2008,2009,2014,2016,2017 -./bin/named/unix/os.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2013,2014,2015,2016,2017 +./bin/named/unix/os.c C 1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2010,2011,2013,2014,2015,2016,2017,2018 ./bin/named/win32/dlz_dlopen_driver.c C 2011,2012,2013,2014,2016 ./bin/named/win32/include/named/ntservice.h C 1999,2000,2001,2002,2003,2004,2007,2016 ./bin/named/win32/include/named/os.h C 1999,2000,2001,2002,2004,2007,2008,2009,2014,2016,2017 From a0720c9e5632cbc4018bf6910fa158b74ff0c3e4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 16:14:08 +1100 Subject: [PATCH 66/74] return failure count --- bin/tests/mem/t_mem.c | 4 ++-- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/mem/t_mem.c b/bin/tests/mem/t_mem.c index e4b2fd90bf..c55d7ea2f9 100644 --- a/bin/tests/mem/t_mem.c +++ b/bin/tests/mem/t_mem.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1999-2001, 2004, 2007, 2009, 2013, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1999-2001, 2004, 2007, 2009, 2013, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -170,7 +170,7 @@ memtest(void) { isc_mem_destroy(&mctx); - return(0); + return(nfails); } static const char *a1 = diff --git a/util/copyrights b/util/copyrights index 7f7044d154..777b73ccf3 100644 --- a/util/copyrights +++ b/util/copyrights @@ -491,7 +491,7 @@ ./bin/tests/master/win32/t_master.vcxproj.user X 2013 ./bin/tests/master_test.c C 1999,2000,2001,2004,2007,2009,2015,2016,2017 ./bin/tests/mem/Makefile.in MAKE 1998,1999,2000,2001,2002,2004,2005,2007,2009,2012,2014,2016,2017 -./bin/tests/mem/t_mem.c C 1999,2000,2001,2004,2007,2009,2013,2016 +./bin/tests/mem/t_mem.c C 1999,2000,2001,2004,2007,2009,2013,2016,2018 ./bin/tests/mem/win32/t_mem.vcxproj.filters.in X 2013,2015 ./bin/tests/mem/win32/t_mem.vcxproj.in X 2013,2015,2016,2017 ./bin/tests/mem/win32/t_mem.vcxproj.user X 2013 From a46e90b2b76a3008700c3e28f4b07a0b7cfdfc59 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 16:21:57 +1100 Subject: [PATCH 67/74] add POST(tl) --- lib/dns/rdata.c | 4 +++- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index 204729c441..42d4e2dc05 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1998-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1460,6 +1460,7 @@ txt_totext(isc_region_t *source, isc_boolean_t quote, isc_buffer_t *target) { return (ISC_R_NOSPACE); *tp++ = '"'; tl--; + POST(tl); } isc_buffer_add(target, (unsigned int)(tp - (char *)region.base)); isc_region_consume(source, *source->base + 1); @@ -1610,6 +1611,7 @@ multitxt_totext(isc_region_t *source, isc_buffer_t *target) { return (ISC_R_NOSPACE); *tp++ = '"'; tl--; + POST(tl); isc_buffer_add(target, (unsigned int)(tp - (char *)region.base)); return (ISC_R_SUCCESS); } diff --git a/util/copyrights b/util/copyrights index 777b73ccf3..a3b37ab2d5 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3485,7 +3485,7 @@ ./lib/dns/rbtdb64.c C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/rbtdb64.h C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/rcode.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 -./lib/dns/rdata.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/rdata.c C 1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/rdata/any_255/tsig_250.c C 1999,2000,2001,2002,2003,2004,2005,2007,2009,2011,2012,2015,2016,2017 ./lib/dns/rdata/any_255/tsig_250.h C 1999,2000,2001,2004,2005,2007,2016 ./lib/dns/rdata/ch_3/a_1.c C 2005,2007,2009,2014,2015,2016,2017 From 99d02c6531819eaac011cb61a740d4f2820f6f0d Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 18:09:29 +1100 Subject: [PATCH 68/74] Clarify calculation precedence for '&' and '?' --- lib/dns/tests/rdatasetstats_test.c | 19 ++++++++++--------- util/copyrights | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/dns/tests/rdatasetstats_test.c b/lib/dns/tests/rdatasetstats_test.c index 3c32f8123a..5d9389adb2 100644 --- a/lib/dns/tests/rdatasetstats_test.c +++ b/lib/dns/tests/rdatasetstats_test.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2012, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -54,6 +54,7 @@ set_nxdomainstats(dns_stats_t *stats, isc_boolean_t stale) { dns_rdatasetstats_increment(stats, which); } +#define ATTRIBUTE_SET(y) ((attributes & (y)) != 0) static void checkit1(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) { unsigned int attributes; @@ -69,10 +70,10 @@ checkit1(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) { type = DNS_RDATASTATSTYPE_BASE(which); fprintf(stderr, "%s%s%s%s/%u, %u\n", - attributes & DNS_RDATASTATSTYPE_ATTR_OTHERTYPE ? "O" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_NXRRSET ? "!" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_STALE ? "#" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_NXDOMAIN ? "X" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) ? "O" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXRRSET) ? "!" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ", type, (unsigned)value); #endif if ((attributes & DNS_RDATASTATSTYPE_ATTR_STALE) == 0) @@ -96,10 +97,10 @@ checkit2(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) { type = DNS_RDATASTATSTYPE_BASE(which); fprintf(stderr, "%s%s%s%s/%u, %u\n", - attributes & DNS_RDATASTATSTYPE_ATTR_OTHERTYPE ? "O" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_NXRRSET ? "!" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_STALE ? "#" : " ", - attributes & DNS_RDATASTATSTYPE_ATTR_NXDOMAIN ? "X" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) ? "O" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXRRSET) ? "!" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ", + ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ", type, (unsigned)value); #endif if ((attributes & DNS_RDATASTATSTYPE_ATTR_STALE) == 0) diff --git a/util/copyrights b/util/copyrights index a3b37ab2d5..b4d1fd77de 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3697,7 +3697,7 @@ ./lib/dns/tests/rbt_test.c C 2012,2013,2014,2015,2016,2017 ./lib/dns/tests/rdata_test.c C 2012,2013,2015,2016,2017 ./lib/dns/tests/rdataset_test.c C 2012,2016 -./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016 +./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016,2018 ./lib/dns/tests/rsa_test.c C 2016 ./lib/dns/tests/testdata/dbiterator/zone1.data ZONE 2011,2012,2016 ./lib/dns/tests/testdata/dbiterator/zone2.data X 2011 From 801cef968488e31c0046d4ddf3b706b34776b9d6 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 15 Feb 2018 18:18:19 +1100 Subject: [PATCH 69/74] add POST(len); --- lib/dns/spnego_asn1.c | 3 ++- util/copyrights | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/dns/spnego_asn1.c b/lib/dns/spnego_asn1.c index 83191fd79d..4a5091fddc 100644 --- a/lib/dns/spnego_asn1.c +++ b/lib/dns/spnego_asn1.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2012, 2013, 2015, 2016 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2006, 2007, 2012, 2013, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -358,6 +358,7 @@ decode_ContextFlags(const unsigned char *p, size_t len, ContextFlags * data, siz return ASN1_OVERRUN; p++; len--; + POST(len); reallen--; ret++; data->delegFlag = (*p >> 7) & 1; diff --git a/util/copyrights b/util/copyrights index b4d1fd77de..c021071346 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3662,7 +3662,7 @@ ./lib/dns/spnego.asn1 X 2006 ./lib/dns/spnego.c C 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 ./lib/dns/spnego.h C 2006,2007,2016 -./lib/dns/spnego_asn1.c C 2006,2007,2012,2013,2015,2016 +./lib/dns/spnego_asn1.c C 2006,2007,2012,2013,2015,2016,2018 ./lib/dns/spnego_asn1.pl PERL 2006,2007,2012,2016 ./lib/dns/ssu.c C 2000,2001,2003,2004,2005,2006,2007,2008,2010,2011,2013,2014,2016,2017,2018 ./lib/dns/ssu_external.c C 2011,2012,2013,2016,2017 From 2e83674170905b96bfea8384f633211abc141753 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 16 Feb 2018 08:37:33 +1100 Subject: [PATCH 70/74] conditionally declare stacksize --- lib/isc/pthreads/thread.c | 5 ++++- util/copyrights | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/isc/pthreads/thread.c b/lib/isc/pthreads/thread.c index 78252dd78d..c07b35976d 100644 --- a/lib/isc/pthreads/thread.c +++ b/lib/isc/pthreads/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000, 2001, 2003-2005, 2007, 2013, 2016, 2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2000, 2001, 2003-2005, 2007, 2013, 2016-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -28,7 +28,10 @@ isc_thread_create(isc_threadfunc_t func, isc_threadarg_t arg, isc_thread_t *thread) { pthread_attr_t attr; +#if defined(HAVE_PTHREAD_ATTR_GETSTACKSIZE) && \ + defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) size_t stacksize; +#endif int ret; pthread_attr_init(&attr); diff --git a/util/copyrights b/util/copyrights index c021071346..6096708d75 100644 --- a/util/copyrights +++ b/util/copyrights @@ -4005,7 +4005,7 @@ ./lib/isc/pthreads/include/isc/once.h C 1999,2000,2001,2004,2005,2007,2016 ./lib/isc/pthreads/include/isc/thread.h C 1998,1999,2000,2001,2004,2005,2007,2013,2016,2017 ./lib/isc/pthreads/mutex.c C 2000,2001,2002,2004,2005,2007,2008,2011,2012,2014,2015,2016 -./lib/isc/pthreads/thread.c C 2000,2001,2003,2004,2005,2007,2013,2016,2017 +./lib/isc/pthreads/thread.c C 2000,2001,2003,2004,2005,2007,2013,2016,2017,2018 ./lib/isc/quota.c C 2000,2001,2004,2005,2007,2016 ./lib/isc/radix.c C 2007,2008,2009,2011,2012,2013,2014,2015,2016 ./lib/isc/random.c C 1999,2000,2001,2002,2003,2004,2005,2007,2009,2013,2014,2016,2017 From f181b30918d6f0660ec620e99c398574ad9aa051 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 16 Feb 2018 08:41:41 +1100 Subject: [PATCH 71/74] add POST(len); --- lib/dns/spnego.c | 4 +++- util/copyrights | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c index 377fd06fcb..de718a94ca 100644 --- a/lib/dns/spnego.c +++ b/lib/dns/spnego.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2017 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2006-2018 Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -1161,6 +1161,7 @@ der_put_int(unsigned char *p, size_t len, int val, size_t *size) return (ASN1_OVERFLOW); *p-- = 0; len--; + POST(len); } } else { val = ~val; @@ -1176,6 +1177,7 @@ der_put_int(unsigned char *p, size_t len, int val, size_t *size) return (ASN1_OVERFLOW); *p-- = 0xff; len--; + POST(len); } } *size = base - p; diff --git a/util/copyrights b/util/copyrights index 6096708d75..2b859d1134 100644 --- a/util/copyrights +++ b/util/copyrights @@ -3660,7 +3660,7 @@ ./lib/dns/sdlz.c C.PORTION 1999,2000,2001,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/soa.c C 2000,2001,2004,2005,2007,2009,2016 ./lib/dns/spnego.asn1 X 2006 -./lib/dns/spnego.c C 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 +./lib/dns/spnego.c C 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018 ./lib/dns/spnego.h C 2006,2007,2016 ./lib/dns/spnego_asn1.c C 2006,2007,2012,2013,2015,2016,2018 ./lib/dns/spnego_asn1.pl PERL 2006,2007,2012,2016 From b75627eacf40e3e9a17982d754ccb63689d98c40 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 16 Feb 2018 10:34:49 +1100 Subject: [PATCH 72/74] add CHANGES note --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 58c1fa8009..05fea0488f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +4893. [bug] Address various issues reported by cppchecker. + 4892. [bug] named could leak memory when "rndc reload" was invoked before all zone loading actions triggered by a previous "rndc reload" command were completed. [RT #47076] From 0d5eed53e84f6b4b56ab832ca8e48d4f209ef76b Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 16 Feb 2018 11:21:16 +1100 Subject: [PATCH 73/74] add GL issue number --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 05fea0488f..7187800b27 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -4893. [bug] Address various issues reported by cppchecker. +4893. [bug] Address various issues reported by cppchecker. [GL #51] 4892. [bug] named could leak memory when "rndc reload" was invoked before all zone loading actions triggered by a previous From fd2d8465a710397377c1d474b1ec35e32d09d035 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 16 Feb 2018 11:24:29 +1100 Subject: [PATCH 74/74] s/cppchecker/cppcheck --- CHANGES | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 7187800b27..8b8886129b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -4893. [bug] Address various issues reported by cppchecker. [GL #51] +4893. [bug] Address various issues reported by cppcheck. [GL #51] 4892. [bug] named could leak memory when "rndc reload" was invoked before all zone loading actions triggered by a previous