1. 25 Mar, 2020 1 commit
    • Ondřej Surý's avatar
      Fix 'Dereference of null pointer' from scan-build-10 · 0fdc09ef
      Ondřej Surý authored
      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 4 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.
      
      --
      
      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.
      
      --
      
      ./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
      
      (cherry picked from commit ddd0d356)
      0fdc09ef
  2. 21 Feb, 2020 1 commit
  3. 14 Feb, 2020 2 commits
  4. 13 Feb, 2020 1 commit
  5. 12 Feb, 2020 1 commit
  6. 10 Feb, 2020 1 commit
  7. 03 Feb, 2020 1 commit
  8. 26 Nov, 2019 1 commit
    • Mark Andrews's avatar
      dns_master_indent and dns_master_indentstr must not be global · 9936462f
      Mark Andrews authored
      The indentation for dumping the master zone was driven by two
      global variables dns_master_indent and dns_master_indentstr.  In
      threaded mode, this becomes prone to data access races, so this commit
      converts the global variables into a local per-context tuple that
      consist of count and string.
      9936462f
  9. 12 Sep, 2019 1 commit
  10. 23 Jul, 2019 1 commit
  11. 09 May, 2019 2 commits
  12. 08 Mar, 2019 2 commits
  13. 06 Feb, 2019 1 commit
  14. 11 Dec, 2018 1 commit
  15. 08 Nov, 2018 1 commit
  16. 28 Aug, 2018 1 commit
  17. 08 Aug, 2018 2 commits
  18. 19 Jul, 2018 1 commit
  19. 05 Jun, 2018 1 commit
  20. 22 May, 2018 1 commit
    • Ondřej Surý's avatar
      address win32 build issues · 7ee8a7e6
      Ondřej Surý authored
      - Replace external -DOPENSSL/-DPKCS11CRYPTO with properly AC_DEFINEd
        HAVE_OPENSSL/HAVE_PKCS11
      - Don't enforce the crypto provider from platform.h, just from dst_api.c
        and configure scripts
      7ee8a7e6
  21. 16 May, 2018 1 commit
    • Ondřej Surý's avatar
      Replace all random functions with isc_random, isc_random_buf and isc_random_uniform API. · 3a4f820d
      Ondřej Surý authored
      The three functions has been modeled after the arc4random family of
      functions, and they will always return random bytes.
      
      The isc_random family of functions internally use these CSPRNG (if available):
      
      1. getrandom() libc call (might be available on Linux and Solaris)
      2. SYS_getrandom syscall (might be available on Linux, detected at runtime)
      3. arc4random(), arc4random_buf() and arc4random_uniform() (available on BSDs and Mac OS X)
      4. crypto library function:
      4a. RAND_bytes in case OpenSSL
      4b. pkcs_C_GenerateRandom() in case PKCS#11 library
      3a4f820d
  22. 09 Apr, 2018 1 commit
    • Michał Kępień's avatar
      Use dns_fixedname_initname() where possible · 4df4a8e7
      Michał Kępień authored
      Replace dns_fixedname_init() calls followed by dns_fixedname_name()
      calls with calls to dns_fixedname_initname() where it is possible
      without affecting current behavior and/or performance.
      
      This patch was mostly prepared using Coccinelle and the following
      semantic patch:
      
          @@
          expression fixedname, name;
          @@
          -	dns_fixedname_init(&fixedname);
          	...
          -	name = dns_fixedname_name(&fixedname);
          +	name = dns_fixedname_initname(&fixedname);
      
      The resulting set of changes was then manually reviewed to exclude false
      positives and apply minor tweaks.
      
      It is likely that more occurrences of this pattern can be refactored in
      an identical way.  This commit only takes care of the low-hanging fruit.
      4df4a8e7
  23. 06 Apr, 2018 4 commits
  24. 04 Apr, 2018 1 commit
  25. 23 Feb, 2018 1 commit
  26. 31 Jan, 2018 2 commits
  27. 09 Oct, 2017 1 commit
  28. 05 Oct, 2017 2 commits