Files
bind9/bin/dnssec
Ondřej Surý f3ba17fedc 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:

dnssec-cds.c:781:4: warning: Access to field 'base' results in a dereference of a null pointer (loaded from variable 'buf')
                        isc_buffer_availableregion(buf, &r);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:996:36: note: expanded from macro 'isc_buffer_availableregion'
                                   ^
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:821:16: note: expanded from macro 'ISC__BUFFER_AVAILABLEREGION'
                (_r)->base = isc_buffer_used(_b);              \
                             ^~~~~~~~~~~~~~~~~~~
/builds/isc-projects/bind9/lib/isc/include/isc/buffer.h:152:29: note: expanded from macro 'isc_buffer_used'
        ((void *)((unsigned char *)(b)->base + (b)->used)) /*d*/
                                   ^~~~~~~~~
1 warning generated.

--

./main.c:1254:9: warning: Access to field 'sctx' results in a dereference of a null pointer (loaded from variable 'named_g_server')
        sctx = named_g_server->sctx;
               ^~~~~~~~~~~~~~~~~~~~
1 warning generated.

References:
1. https://clang-analyzer.llvm.org/faq.html#null_pointer
2020-03-26 13:42:35 +01:00
..
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2019-11-12 09:27:19 +01:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2019-11-12 09:27:19 +01:00
2020-01-27 11:06:04 -08:00
2020-02-12 20:07:41 +00:00
2019-01-02 10:56:59 +11:00
2020-02-12 20:07:41 +00:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2020-01-27 11:06:04 -08:00
2019-11-12 09:27:19 +01:00