mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-19 00:55:01 -04:00
Compiling with -O3 triggers the following warnings with GCC 9.1:
task.c: In function ‘isc_taskmgr_create’:
task.c:1386:43: warning: ‘%04u’ directive output may be truncated writing between 4 and 10 bytes into a region of size 6 [-Wformat-truncation=]
1386 | snprintf(name, sizeof(name), "isc-worker%04u", i);
| ^~~~
task.c:1386:32: note: directive argument in the range [0, 4294967294]
1386 | snprintf(name, sizeof(name), "isc-worker%04u", i);
| ^~~~~~~~~~~~~~~~
task.c:1386:3: note: ‘snprintf’ output between 15 and 21 bytes into a destination of size 16
1386 | snprintf(name, sizeof(name), "isc-worker%04u", i);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private_test.c: In function ‘private_nsec3_totext_test’:
private_test.c:113:9: warning: array subscript 4 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
113 | while (*sp == '\0' && slen > 0) {
| ^~~
private_test.c:106:11: note: while referencing ‘salt’
106 | uint32_t salt;
| ^~~~
Prevent these warnings from being triggered by increasing the size of
the relevant array (task.c) and reordering conditions (private_test.c).
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| testdata | ||
| testkeys | ||
| .gitignore | ||
| acl_test.c | ||
| db_test.c | ||
| dbdiff_test.c | ||
| dbiterator_test.c | ||
| dbversion_test.c | ||
| dh_test.c | ||
| dispatch_test.c | ||
| dnstap_test.c | ||
| dnstest.c | ||
| dnstest.h | ||
| dst_test.c | ||
| geoip_test.c | ||
| Kdh.+002+18602.key | ||
| keytable_test.c | ||
| Krsa.+005+29235.key | ||
| Kyuafile | ||
| Makefile.in | ||
| master_test.c | ||
| mkraw.pl | ||
| name_test.c | ||
| nsec3_test.c | ||
| peer_test.c | ||
| private_test.c | ||
| rbt_serialize_test.c | ||
| rbt_test.c | ||
| rdata_test.c | ||
| rdataset_test.c | ||
| rdatasetstats_test.c | ||
| resolver_test.c | ||
| result_test.c | ||
| rsa_test.c | ||
| sigs_test.c | ||
| time_test.c | ||
| tkey_test.c | ||
| tsig_test.c | ||
| update_test.c | ||
| zonemgr_test.c | ||
| zt_test.c | ||