bind9/bin/tests/optional
Ondřej Surý 9b76eea08f Fix 'Dereference of null pointer' from scan-build-10
These are mostly false positives, the clang-analyzer FAQ[1] specifies
why and how to fix it:

> The reason the analyzer often thinks that a pointer can be null is
> because the preceding code checked compared it against null. So if you
> are absolutely sure that it cannot be null, remove the preceding check
> and, preferably, add an assertion as well.

The 2 warnings reported are:

byname_test.c:308:34: warning: Access to field 'fwdtable' results in a dereference of a null pointer (loaded from variable 'view')
                RUNTIME_CHECK(dns_fwdtable_add(view->fwdtable, dns_rootname,
                                               ^~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/util.h:318:52: note: expanded from macro 'RUNTIME_CHECK'
                                                   ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/error.h:50:21: note: expanded from macro 'ISC_ERROR_RUNTIMECHECK'
        ((void)(ISC_LIKELY(cond) ||  \
                           ^~~~
/builds/isc-projects/bind9/lib/isc/include/isc/likely.h:23:43: note: expanded from macro 'ISC_LIKELY'
                                            ^
1 warning generated.

--

./rndc.c:255:6: warning: Dereference of null pointer (loaded from variable 'host')
        if (*host == '/') {
            ^~~~~
1 warning generated.

References:
1. https://clang-analyzer.llvm.org/faq.html#null_pointer

(cherry picked from commit ddd0d356e5)
2020-03-25 18:09:20 +01:00
..
adb_test.c fix additional spelling errors 2020-02-24 22:04:43 -08:00
backtrace_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
byaddr_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
byname_test.c Fix 'Dereference of null pointer' from scan-build-10 2020-03-25 18:09:20 +01:00
db_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
dst_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
entropy2_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
entropy_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
fsaccess_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
gsstest.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
gxba_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
gxbn_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
hash_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
inter_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
Kchild.example.+003+04017.key move all optional tests from bin/tests to bin/tests/optional 2018-03-09 15:29:59 -08:00
Kchild.example.+003+04017.private move all optional tests from bin/tests to bin/tests/optional 2018-03-09 15:29:59 -08:00
keyboard_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
lex_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
lfsr_test.c fix spelling errors reported by Fossies. 2020-02-21 14:09:59 -08:00
log_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
lwres_test.c Update lwres to use stdint types to finish transition to using stdint types 2018-08-22 09:04:02 +02:00
lwresconf_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
Makefile.in add a search for GeoIP2 libraries in configure 2019-07-02 12:28:14 -07:00
master_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
mempool_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
name_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
nsecify.c address or suppress cppcheck warnings 2019-09-12 19:31:56 +10:00
ratelimiter_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
rbt_test.c fix spelling errors reported by Fossies. 2020-02-21 14:09:59 -08:00
rbt_test.out move all optional tests from bin/tests to bin/tests/optional 2018-03-09 15:29:59 -08:00
rbt_test.txt update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
rwlock_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
serial_test.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
shutdown_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
sig0_test.c delay assignment until after REQUIRE 2020-02-08 06:32:42 -08:00
sock_test.c Silence Coverity CHECKED_RETURN warnings 2020-02-11 13:02:08 +00:00
sym_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
task_test.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
timer_test.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
zone_test.c fix spelling errors reported by Fossies. 2020-02-21 14:09:59 -08:00