[tor-bugs] #25912 [Core Tor/Tor]: CID 1435130: Incorrect expression (COPY_PASTE_ERROR)

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Apr 25 08:20:32 UTC 2018


#25912: CID 1435130:  Incorrect expression  (COPY_PASTE_ERROR)
-------------------------+-------------------------------------------------
     Reporter:  asn      |      Owner:  (none)
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:  Tor: 0.3.3.x-final
    Component:  Core     |    Version:  Tor: 0.3.1.9
  Tor/Tor                |   Keywords:  prop286, 034-triage-20180328,
     Severity:  Normal   |  034-must crash 033-backport 032-backport
                         |  031-backport
Actual Points:           |  Parent ID:
       Points:           |   Reviewer:
      Sponsor:           |
-------------------------+-------------------------------------------------
 Seems like #23693 caused the following coverity warning:
 {{{
 ** CID 1435130:  Incorrect expression  (COPY_PASTE_ERROR)
 /src/or/router.c: 153 in dup_onion_keys()

 ________________________________________________________________________________________________________
 *** CID 1435130:  Incorrect expression  (COPY_PASTE_ERROR)
 /src/or/router.c: 153 in dup_onion_keys()
 147       tor_assert(key);
 148       tor_assert(last);
 149       tor_mutex_acquire(key_lock);
 150       if (onionkey)
 151         *key = crypto_pk_copy_full(onionkey);
 152       else
 >>>     CID 1435130:  Incorrect expression  (COPY_PASTE_ERROR)
 >>>     "last" in "*last = NULL" looks like a copy-paste error.
 153         *last = NULL;
 154       if (lastonionkey)
 155         *last = crypto_pk_copy_full(lastonionkey);
 156       else
 157         *last = NULL;
 158       tor_mutex_release(key_lock);
 }}}

 Perhaps this new `*last = NULL;` should have been `*key = NULL`.

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


More information about the tor-bugs mailing list