1. 05 Feb, 2020 23 commits
    • Mark Andrews's avatar
      wait a short while for no NSEC3PARAM · 4e2ac5f6
      Mark Andrews authored
      4e2ac5f6
    • Mark Andrews's avatar
      Merge branch 'marka-coverity-master' into 'master' · dd6598f3
      Mark Andrews authored
      Address various minor issues identified by coverity on master
      
      See merge request !2999
      dd6598f3
    • Mark Andrews's avatar
      'dispatch' must be non NULL, remove test. · 891f24fa
      Mark Andrews authored
      10067 cleanup:
      
      	CID 1452683 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking dispatch suggests that it
      	may be null, but it has already been dereferenced on all
      	paths leading to the check.
      
      10068        if (dispatch != NULL)
      10069                isc_mem_put(server->mctx, dispatch, sizeof(*dispatch));
      891f24fa
    • Mark Andrews's avatar
      'dctx' must be non NULL, remove test. · fccf65a5
      Mark Andrews authored
      1549 cleanup:
      1550        if (dctx->dbiter != NULL)
      1551                dns_dbiterator_destroy(&dctx->dbiter);
      1552        if (dctx->db != NULL)
      1553                dns_db_detach(&dctx->db);
      
      	CID 1452686 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking dctx suggests that it may
      	be null, but it has already been dereferenced on all paths
      	leading to the check.
      
      1554        if (dctx != NULL)
      1555                isc_mem_put(mctx, dctx, sizeof(*dctx));
      fccf65a5
    • Mark Andrews's avatar
      'dir_list' must be non NULL, remove test. · bf7a99a3
      Mark Andrews authored
      707 complete_allnds:
      
      	CID 1452689 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking dir_list suggests that it
      	may be null, but it has already been dereferenced on all
      	paths leading to the check.
      
      708        if (dir_list != NULL) {
      709                /* clean up entries from list. */
      bf7a99a3
    • Mark Andrews's avatar
      'lcfg' must be non NULL, remove test. · 7ba1af02
      Mark Andrews authored
      389        else
      
      	CID 1452695 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking lcfg suggests that it may
      	be null, but it has already been dereferenced on all paths
      	leading to the check.
      
      390                if (lcfg != NULL)
      391                        isc_logconfig_destroy(&lcfg);
      7ba1af02
    • Mark Andrews's avatar
      's' must be non NULL, remove test. · 714594d4
      Mark Andrews authored
      122 cleanup:
      
      	CID 1452696 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking s suggests that it may be
      	null, but it has already been dereferenced on all paths
      	leading to the check.
      
      123        if (s != NULL)
      124                isc_mem_free(mctx, s);
      714594d4
    • Mark Andrews's avatar
      'tql' must be non NULL, remove test. · 44b08521
      Mark Andrews authored
      255 flag_fail:
      256        /* get rid of what was build of the query list */
      
      	CID 1452697 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking tql suggests that it may
      	be null, but it has already been dereferenced on all paths
      	leading to the check.
      
      257        if (tql != NULL)
      258                destroy_querylist(mctx, &tql);
      44b08521
    • Mark Andrews's avatar
      'closest' must be non NULL, remove test. · 0312e73e
      Mark Andrews authored
      6412 cleanup:
      6413        dns_rdataset_disassociate(&neg);
      6414        dns_rdataset_disassociate(&negsig);
      
      	CID 1452700 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking closest suggests that it
      	may be null, but it has already been dereferenced on all
      	paths leading to the check.
      
      6415        if (closest != NULL)
      6416                free_noqname(mctx, &closest);
      0312e73e
    • Mark Andrews's avatar
      cleanup error handling. · d6492184
      Mark Andrews authored
      336 cleanup_mem:
      337        /* cleanup memory */
      338
      339        /* free tmpPath memory */
      
      	CID 1452701 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking tmpPath suggests that it
      	may be null, but it has already been dereferenced on all
      	paths leading to the check.
      
      340        if (tmpPath != NULL && result != ISC_R_SUCCESS)
      341                isc_mem_free(named_g_mctx, tmpPath);
      342
      343        /* free tmpPath memory */
      344        return (result);
      d6492184
    • Mark Andrews's avatar
      'stub' cannot be non NULL, remove test. · 2e189bb0
      Mark Andrews authored
      13429 cleanup:
      13430        cancel_refresh(zone);
      
      	CID 1452702 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking stub suggests that it may
      	be null, but it has already been dereferenced on all paths
      	leading to the check.
      
      13431        if (stub != NULL) {
      13432                stub->magic = 0;
      2e189bb0
    • Mark Andrews's avatar
      'noqname' must be non NULL, remove test. · 1b1a94ea
      Mark Andrews authored
      6367cleanup:
      6368        dns_rdataset_disassociate(&neg);
      6369        dns_rdataset_disassociate(&negsig);
      
      	CID 1452704 (#1 of 1): Dereference before null check
      	(REVERSE_INULL) check_after_deref: Null-checking noqname
      	suggests that it may be null, but it has already been
      	dereferenced on all paths leading to the check.
      
      6370        if (noqname != NULL)
      6371                free_noqname(mctx, &noqname);
      1b1a94ea
    • Mark Andrews's avatar
      'dctx' must be non NULL, remove test. · 8456b562
      Mark Andrews authored
      11030 cleanup:
      
      	CID 1452705 (#1 of 1): Dereference before null check
      	(REVERSE_INULL) check_after_deref: Null-checking dctx
      	suggests that it may be null, but it has already been
      	dereferenced on all paths leading to the check.
      
      11031        if (dctx != NULL)
      11032                dumpcontext_destroy(dctx);
      11033        return (result);
      8456b562
    • Mark Andrews's avatar
      'event' must be non NULL, remove test. · e4d08c02
      Mark Andrews authored
      1401        }
      
      	CID 1453455 (#1 of 1): Dereference before null check (REVERSE_INULL)
      	check_after_deref: Null-checking event suggests that it may be null,
      	but it has already been dereferenced on all paths leading to the check.
      
      1402        if (event != NULL)
      1403                isc_event_free(ISC_EVENT_PTR(&event));
      e4d08c02
    • Mark Andrews's avatar
      remove dead cleanup code. · b6c3a2f1
      Mark Andrews authored
      13836        if (zone != NULL)
      13837                dns_zone_detach(&zone);
      
           	null: At condition dz != NULL, the value of dz must be NULL.
           	dead_error_condition: The condition dz != NULL cannot be true.
      
      13838        if (dz != NULL) {
      
      	CID 1453456 (#1 of 1): Logically dead code (DEADCODE)
      	dead_error_begin: Execution cannot reach this statement:
      	dns_zone_detach(&dz->zone);.
      
      13839                dns_zone_detach(&dz->zone);
      13840                isc_mem_put(named_g_mctx, dz, sizeof(*dz));
      13841        }
      b6c3a2f1
    • Mark Andrews's avatar
      keymgr_keyrole couldn't emit "NOSIGN". · 1efc7550
      Mark Andrews authored
       92        } else {
       93                return ("ZSK");
       94        }
      
      	CID 1455900 (#1 of 1): Structurally dead code (UNREACHABLE)
      	unreachable: This code cannot be reached: return "NOSIGN";.
      
       95        return ("NOSIGN");
      1efc7550
    • Mark Andrews's avatar
      Remove dead error code. · 5fc9efba
      Mark Andrews authored
      128        return (ISC_R_SUCCESS);
      129
      
      	CID 1456146 (#1 of 1): Structurally dead code (UNREACHABLE)
      	unreachable: This code cannot be reached: {
      	   if (dst->labels[i] != N....
      
      130        do {
      5fc9efba
    • Mark Andrews's avatar
      'indentctx' is always defined. Just use it. · aa101260
      Mark Andrews authored
      402        ctx->serve_stale_ttl = 0;
      
      	notnull: At condition indentctx, the value of indentctx
      	cannot be NULL.  dead_error_condition: The condition indentctx
      	must be true.
      
      	CID 1456147 (#1 of 1): Logically dead code (DEADCODE)
      	dead_error_line: Execution cannot reach the expression
      	default_indent inside this statement: ctx->indent = (indentctx
      	? ....
      
      403        ctx->indent = indentctx ? *indentctx : default_indent;
      aa101260
    • Mark Andrews's avatar
      break was on wrong line. · 0be2dc9f
      Mark Andrews authored
       959                break;
      
      	CID 1457872 (#1 of 1): Structurally dead code (UNREACHABLE)
      	unreachable: This code cannot be reached:
      	isc__nm_incstats(sock->mgr,....
      
       960                isc__nm_incstats(sock->mgr, sock->statsindex[STATID_ACTIVE]);
       961        default:
      0be2dc9f
    • Mark Andrews's avatar
      dstkey is no longer used · 331b74d6
      Mark Andrews authored
      331b74d6
    • Mark Andrews's avatar
      'buffer' must be non-NULL as isc_buffer_allocate can no longer fail. · a038f77d
      Mark Andrews authored
      1636 cleanup:
      
      CID 1458130 (#1 of 1): Dereference before null check (REVERSE_INULL)
      check_after_deref: Null-checking buffer suggests that it may be
      null, but it has already been dereferenced on all paths leading to
      the check.
      
      1637        if (buffer != NULL)
      1638                isc_buffer_free(&buffer);
      a038f77d
    • Ondřej Surý's avatar
      Merge branch 'ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop' into 'master' · d162bbcc
      Ondřej Surý authored
      Fix comparison between type uint16_t and  wider type size_t in a loop
      
      See merge request !2986
      d162bbcc
    • Ondřej Surý's avatar
      Fix comparison between type uint16_t and wider type size_t in a loop · a9bd6f6e
      Ondřej Surý authored and Mark Andrews's avatar Mark Andrews committed
      Found by LGTM.com (see below for description), and while it should not
      happen as EDNS OPT RDLEN is uint16_t, the fix is easy.  A little bit
      of cleanup is included too.
      
      > In a loop condition, comparison of a value of a narrow type with a value
      > of a wide type may result in unexpected behavior if the wider value is
      > sufficiently large (or small). This is because the narrower value may
      > overflow. This can lead to an infinite loop.
      a9bd6f6e
  2. 04 Feb, 2020 17 commits