mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-27 20:11:12 -05:00
cppcheck is not aware that the bin/dnssec/dnssectool.c:fatal() function
does not return. This triggers certain cppcheck 2.2 false positives,
for example:
bin/dnssec/dnssec-signzone.c:3470:13: warning: Either the condition 'ndskeys==8' is redundant or the array 'dskeyfile[8]' is accessed at index 8, which is out of bounds. [arrayIndexOutOfBoundsCond]
dskeyfile[ndskeys++] = isc_commandline_argument;
^
bin/dnssec/dnssec-signzone.c:3467:16: note: Assuming that condition 'ndskeys==8' is not redundant
if (ndskeys == MAXDSKEYS) {
^
bin/dnssec/dnssec-signzone.c:3470:13: note: Array index out of bounds
dskeyfile[ndskeys++] = isc_commandline_argument;
^
bin/dnssec/dnssec-signzone.c:771:20: warning: Either the condition 'l->hashbuf==NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
memset(l->hashbuf + l->entries * l->length, 0, l->length);
^
bin/dnssec/dnssec-signzone.c:767:18: note: Assuming that condition 'l->hashbuf==NULL' is not redundant
if (l->hashbuf == NULL) {
^
bin/dnssec/dnssec-signzone.c:771:20: note: Null pointer addition
memset(l->hashbuf + l->entries * l->length, 0, l->length);
^
Instead of suppressing all such warnings individually, conditionally
define a preprocessor macro which prevents them from being triggered.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| win32 | ||
| .gitignore | ||
| dnssec-cds.c | ||
| dnssec-cds.rst | ||
| dnssec-dsfromkey.c | ||
| dnssec-dsfromkey.rst | ||
| dnssec-importkey.c | ||
| dnssec-importkey.rst | ||
| dnssec-keyfromlabel.c | ||
| dnssec-keyfromlabel.rst | ||
| dnssec-keygen.c | ||
| dnssec-keygen.rst | ||
| dnssec-revoke.c | ||
| dnssec-revoke.rst | ||
| dnssec-settime.c | ||
| dnssec-settime.rst | ||
| dnssec-signzone.c | ||
| dnssec-signzone.rst | ||
| dnssec-verify.c | ||
| dnssec-verify.rst | ||
| dnssectool.c | ||
| dnssectool.h | ||
| Makefile.in | ||