Opened 4 years ago

Closed 3 years ago

#19203 closed defect (fixed)

node_get_by_nickname() fails to give warning on unique-but-unnamed node.

Reported by: nickm Owned by: nickm
Priority: Medium Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 028-backport 027-backport
Cc: Actual Points: .1
Parent ID: Points: .1
Reviewer: Sponsor:


There are two checks in node_get_by_nickname for listing an unnamed router by name. One checks for (smartlist_len(matches)>1 && warn_if_unnamed), whereas the other one also checks for (smartlist_len(matches)>1 && warn_if_unnamed). Whoops.

The impact is that if there is one match, no warning will be produced, even though it arguably should (now that Naming is no longer a thing).

Found by GCC6 with -Wduplicated-cond as part of #19180.

Child Tickets

Change History (6)

comment:1 Changed 4 years ago by nickm

Keywords: 027-backport added
Status: newneeds_review

There is also a reversed check inside that body. I've written a fix in my branch bug19203_027, which we should consider for backport. I'm also rolling it up inside my #19180 work, as necessary for the new warning to to pass.

comment:2 Changed 4 years ago by nickm

Actual Points: .1
Points: .1

comment:3 Changed 4 years ago by andrea

Status: needs_reviewmerge_ready

This looks fine; recommend merging and agree with consideration for backport.

comment:4 Changed 4 years ago by nickm

Milestone: Tor: 0.2.9.x-finalTor: 0.2.7.x-final
Status: merge_readyneeds_review

Merged into 0.2.8 and forward, leaving for possible 0.2.7 backport. [recommendation: unsure.]

comment:5 Changed 4 years ago by nickm

Parent ID: #19180

comment:6 Changed 3 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.8.x-final
Resolution: fixed
Status: needs_reviewclosed

I suggested "no backport" -- nobody objected.

Note: See TracTickets for help on using tickets.