Opened 6 weeks ago

Closed 5 weeks ago

Last modified 3 days ago

#32060 closed defect (fixed)

CID 1454761: wrong type passed to unlock_cb_buf()?

Reported by: teor Owned by: teor
Priority: Medium Milestone: Tor: 0.4.2.x-final
Component: Core Tor/Tor Version: Tor: 0.4.2.2-alpha
Severity: Normal Keywords: 042-must, regression, fast-fix, 042-backport, BugSmashFund
Cc: Actual Points: 0.1
Parent ID: Points: 0.1
Reviewer: Sponsor:

Description

Maybe it should be void *cb_buf[]

CID 1454761:  Incorrect expression  (SIZEOF_MISMATCH)
/src/lib/err/backtrace.c: 107 in unlock_cb_buf()
101     }
102     
103     /** Unlock the static stack pointer buffer. */
104     static void
105     unlock_cb_buf(void *cb_buf)
106     {
   CID 1454761:  Incorrect expression  (SIZEOF_MISMATCH)
   Passing argument "cb_buf" of type "void *" and argument "2048UL /* 256 * sizeof (void *) */" to function "memset" is suspicious.
107       memset(cb_buf, 0, SIZEOF_CB_BUF);
108       pthread_mutex_unlock(&cb_buf_mutex);
109     }

Child Tickets

Change History (5)

comment:1 Changed 6 weeks ago by teor

Component: - Select a componentCore Tor/Tor

comment:2 Changed 5 weeks ago by teor

Actual Points: 0.1
Keywords: fast-fix 042-backport added
Sponsor: Sponsor31-must
Status: assignedneeds_review

See my PR, it's a quick type fix:

comment:3 Changed 5 weeks ago by teor

(No changes file required, because this fix isn't in 0.4.2.2-alpha.)

comment:4 Changed 5 weeks ago by teor

Resolution: fixed
Status: needs_reviewclosed

Merged to 0.4.2 and later: obviously correct fixes to already reviewed code.

comment:5 Changed 3 days ago by teor

Keywords: BugSmashFund added
Sponsor: Sponsor31-must
Note: See TracTickets for help on using tickets.