[tor-bugs] #26269 [Core Tor/Tor]: new compiler warning src/or/router.c:2034:36: warning: potential null pointer dereference

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Jun 2 19:13:29 UTC 2018


#26269: new compiler warning src/or/router.c:2034:36: warning: potential null
pointer dereference
------------------------------+------------------------------
     Reporter:  toralf        |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:
    Component:  Core Tor/Tor  |    Version:  Tor: unspecified
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+------------------------------
 {{{
 CC       src/or/rephist.o
   CC       src/or/router.o
 src/or/router.c: In function ‘router_my_exit_policy_is_reject_star’:
 src/or/router.c:2034:36: warning: potential null pointer dereference
 [-Wnull-dereference]
    return router_get_my_routerinfo()->policy_is_reject_star;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
 src/or/router.c:2034:36: warning: potential null pointer dereference
 [-Wnull-dereference]
 src/or/router.c:2034:36: warning: potential null pointer dereference
 [-Wnull-dereference]
 src/or/router.c: In function ‘check_descriptor_bandwidth_changed’:
 src/or/router.c:2636:36: warning: potential null pointer dereference
 [-Wnull-dereference]
    prev = router_get_my_routerinfo()->bandwidthcapacity;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
 src/or/router.c:2636:36: warning: potential null pointer dereference
 [-Wnull-dereference]
 src/or/router.c:2636:36: warning: potential null pointer dereference
 [-Wnull-dereference]
 src/or/router.c: In function ‘check_descriptor_ipaddress_changed’:
 src/or/router.c:2696:8: warning: potential null pointer dereference
 [-Wnull-dereference]
    prev = router_get_my_routerinfo()->addr;
    ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 src/or/router.c:2696:8: warning: potential null pointer dereference
 [-Wnull-dereference]
 src/or/router.c:2696:8: warning: potential null pointer dereference
 [-Wnull-dereference]
   CC       src/or/routerlist.o
   CC       src/or/dirauth/shared_random.o
 }}}
 and
 {{{
   CC       src/test/src_test_test-test_dos.o
   CC       src/test/src_test_test-test_entrynodes.o
 src/test/test_entrynodes.c: In function
 ‘test_entry_guard_update_from_consensus_repair’:
 src/test/test_entrynodes.c:1254:26: warning: potential null pointer
 dereference [-Wnull-dereference]
      n->is_possible_guard = 0;
      ~~~~~~~~~~~~~~~~~~~~~^~~
 src/test/test_entrynodes.c:1254:26: warning: potential null pointer
 dereference [-Wnull-dereference]
 src/test/test_entrynodes.c: In function
 ‘test_entry_guard_update_from_consensus_remove’:
 src/test/test_entrynodes.c:1319:26: warning: potential null pointer
 dereference [-Wnull-dereference]
      n->is_possible_guard = 0;
      ~~~~~~~~~~~~~~~~~~~~~^~~
 src/test/test_entrynodes.c:1319:26: warning: potential null pointer
 dereference [-Wnull-dereference]
 src/test/test_entrynodes.c:1328:26: warning: potential null pointer
 dereference [-Wnull-dereference]
      n->is_possible_guard = 0;
      ~~~~~~~~~~~~~~~~~~~~~^~~
 src/test/test_entrynodes.c:1328:26: warning: potential null pointer
 dereference [-Wnull-dereference]
 src/test/test_entrynodes.c: In function
 ‘test_entry_guard_update_from_consensus_status’:
 src/test/test_entrynodes.c:1153:26: warning: potential null pointer
 dereference [-Wnull-dereference]
      n->is_possible_guard = 0;
      ~~~~~~~~~~~~~~~~~~~~~^~~
 src/test/test_entrynodes.c:1153:26: warning: potential null pointer
 dereference [-Wnull-dereference]
 src/test/test_entrynodes.c:1191:26: warning: potential null pointer
 dereference [-Wnull-dereference]
      n->is_possible_guard = 1;
      ~~~~~~~~~~~~~~~~~~~~~^~~
 src/test/test_entrynodes.c:1191:26: warning: potential null pointer
 dereference [-Wnull-dereference]
 In file included from ./src/common/crypto.h:21:0,
                  from ./src/or/or.h:69,
                  from src/test/test_entrynodes.c:13:
 src/test/test_entrynodes.c:85:13: warning: potential null pointer
 dereference [-Wnull-dereference]
    tor_free(n->md->onion_curve25519_pkey);
             ~^~~
 ./src/common/util.h:90:39: note: in definition of macro ‘tor_free’
      typeof(&(p)) tor_free__tmpvar = &(p);                      \
                                        ^
 ./src/common/util.h:118:21: warning: potential null pointer dereference
 [-Wnull-dereference]
  #define raw_free    free
                      ^
 ./src/common/util.h:91:5: note: in expansion of macro ‘raw_free’
      raw_free(*tor_free__tmpvar);                               \
      ^~~~~~~~
 src/test/test_entrynodes.c:84:3: note: in expansion of macro ‘tor_free’
    tor_free(n->rs);
    ^~~~~~~~
 ./src/common/util.h:118:21: warning: potential null pointer dereference
 [-Wnull-dereference]
  #define raw_free    free
                      ^
 ./src/common/util.h:91:5: note: in expansion of macro ‘raw_free’
      raw_free(*tor_free__tmpvar);                               \
      ^~~~~~~~
 src/test/test_entrynodes.c:87:3: note: in expansion of macro ‘tor_free’
    tor_free(n->md);
    ^~~~~~~~
 src/test/test_entrynodes.c:86:22: warning: potential null pointer
 dereference [-Wnull-dereference]
    short_policy_free(n->md->exit_policy);
                      ~^~~
 ./src/common/util.h:129:45: note: in definition of macro ‘FREE_AND_NULL’
      typename **tmp__free__ptr ## freefn = &(var);                       \
                                              ^~~
 src/test/test_entrynodes.c:86:3: note: in expansion of macro
 ‘short_policy_free’
    short_policy_free(n->md->exit_policy);
    ^~~~~~~~~~~~~~~~~
 ./src/common/util.h:92:22: warning: potential null pointer dereference
 [-Wnull-dereference]
      *tor_free__tmpvar=NULL;                                    \
                       ^
 src/test/test_entrynodes.c:84:3: note: in expansion of macro ‘tor_free’
    tor_free(n->rs);
    ^~~~~~~~
 src/test/test_entrynodes.c:85:13: warning: potential null pointer
 dereference [-Wnull-dereference]
    tor_free(n->md->onion_curve25519_pkey);
             ~^~~
 ./src/common/util.h:90:39: note: in definition of macro ‘tor_free’
      typeof(&(p)) tor_free__tmpvar = &(p);                      \
                                        ^
 ./src/common/util.h:118:21: warning: potential null pointer dereference
 [-Wnull-dereference]
  #define raw_free    free
                      ^
 ./src/common/util.h:91:5: note: in expansion of macro ‘raw_free’
      raw_free(*tor_free__tmpvar);                               \
      ^~~~~~~~
 src/test/test_entrynodes.c:84:3: note: in expansion of macro ‘tor_free’
    tor_free(n->rs);
    ^~~~~~~~
 ./src/common/util.h:118:21: warning: potential null pointer dereference
 [-Wnull-dereference]
  #define raw_free    free
                      ^
 ./src/common/util.h:91:5: note: in expansion of macro ‘raw_free’
      raw_free(*tor_free__tmpvar);                               \
      ^~~~~~~~
 src/test/test_entrynodes.c:87:3: note: in expansion of macro ‘tor_free’
    tor_free(n->md);
    ^~~~~~~~
 src/test/test_entrynodes.c:86:22: warning: potential null pointer
 dereference [-Wnull-dereference]
    short_policy_free(n->md->exit_policy);
                      ~^~~
 ./src/common/util.h:129:45: note: in definition of macro ‘FREE_AND_NULL’
      typename **tmp__free__ptr ## freefn = &(var);                       \
                                              ^~~
 src/test/test_entrynodes.c:86:3: note: in expansion of macro
 ‘short_policy_free’
    short_policy_free(n->md->exit_policy);
    ^~~~~~~~~~~~~~~~~
 ./src/common/util.h:92:22: warning: potential null pointer dereference
 [-Wnull-dereference]
      *tor_free__tmpvar=NULL;                                    \
                       ^
 src/test/test_entrynodes.c:84:3: note: in expansion of macro ‘tor_free’
    tor_free(n->rs);
    ^~~~~~~~
   CC       src/test/src_test_test-test_extorport.o
   CC       src/test/src_test_test-test_hs_common.o
   CC       src/test/src_test_test-test_hs_cell.o
   CC       src/test/src_test_test-test_hs_service.o
 }}}
 at a stable Gentoo hardened Linux with app-forensics/afl 2.52b and gcc
 (Gentoo Hardened 6.4.0-r1 p1.3) 6.4.0

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/26269>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list