[tor-bugs] #17753 [Tor]: Use internal reputation variables to verify memory allocation
Tor Bug Tracker & Wiki
blackhole at torproject.org
Sun Dec 6 14:22:00 UTC 2015
#17753: Use internal reputation variables to verify memory allocation
-------------------------+------------------------------------
Reporter: cypherpunks | Owner:
Type: defect | Status: needs_review
Priority: Low | Milestone: Tor: 0.2.8.x-final
Component: Tor | Version: Tor: unspecified
Severity: Minor | Resolution:
Keywords: | Actual Points:
Parent ID: | Points:
Sponsor: |
-------------------------+------------------------------------
Changes (by teor):
* status: needs_revision => needs_review
Comment:
Replying to [comment:3 cypherpunks]:
> Replying to [comment:2 teor]:
> > Can you explain the removal of the cast from the line:
> > `lhist = (link_history_t*) digestmap_get(orhist->link_history_map,
to_id); `
> As explained in the commit message, i found this unnecessary cast while
working on the code. The digestmap returns a pointer to void so it
automatically converts to whatever pointer type you assign it to already,
no cast necessary.
Thanks for picking this up, it's the only location in the entire codebase
that we cast the result of digestmap_get. (For those circumstances where
casting is necessary, there are automatically generated functions that
cast to a type.)
> > Did you mean to include it in the patch?
> I did mean to include it in the patch because it was such a small
change, but i agree that it is a bit unrelated. Should i split the commit
in two?
There's no need to split this commit.
(In future, please keep one commit per topic. It's easier for reviewers to
understand.)
Thanks for the patch, I am happy with it. Let's get it merged.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17753#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list