#25912 closed defect (fixed)

CID 1435130: Incorrect expression (COPY_PASTE_ERROR)

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.3.3.x-final
Component: Core Tor/Tor Version: Tor: 0.3.1.9
Severity: Normal Keywords: prop286, 034-triage-20180328, 034-must crash 033-backport 032-backport 031-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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.

Child Tickets

Change History (3)

comment:1 Changed 11 months ago by nickm

Yup, that seems right to me. Fixing...

comment:2 Changed 11 months ago by nickm

Fixed with bb35405d2ad01dbc8cf59ed275c41bd7d6098ae8 in 0.3.1 and forward.

comment:3 Changed 11 months ago by nickm

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.