[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #2183 [Tor Relay]: router_rebuild_descriptor(): Bug: Couldn't generate extra-info descriptor
#2183: router_rebuild_descriptor(): Bug: Couldn't generate extra-info descriptor
-----------------------+----------------------------------------------------
Reporter: Falo | Owner: karsten
Type: defect | Status: needs_review
Priority: normal | Milestone:
Component: Tor Relay | Version: Tor: 0.2.2.17-alpha
Keywords: | Parent:
-----------------------+----------------------------------------------------
Comment(by rransom):
Replying to [comment:14 karsten]:
> Replying to [comment:12 rransom]:
> > See
[http://repo.or.cz/w/tor/rransom.git/shortlog/refs/heads/mitigate2183
mitigate2183] ( !git://repo.or.cz/tor/rransom.git mitigate2183 ) for
patches to make relays generate (and publish) router descriptors even if
they cannot generate their extra-info descriptors.
>
> I think the approach to publish a router descriptor even if we cannot
generate an extra-info descriptor is good.
>
> A quick comment to your patch: You could add a parameter
has_extra_info_digest to router_dump_router_to_string() instead of
iterating over all bytes of extra_info_digest to find out if it contains a
non-zero value.
That flag belongs in the signed_descriptor_t record. I wanted to get a
patch out quickly to publish the router descriptor even if no extra-info
descriptor can be published. Adding a has_extra_info_digest field to
signed_descriptor_t will take more time both to write and to review.
> Also, how about using a new variable for the extra-info-digest line
instead of the "%s%s%s%s" part? Other than that, looks good.
Using three conditional expressions in a row in the arguments to a printf-
like function:
* takes less programmer time,
* takes less source-code space, and
* is harder to screw up in a very harmful way (i.e. buffer overflow)
than allocating a temporary string variable, whether on the stack (as a
local char-array variable) or in the heap (using `tor_malloc_zero` and the
associated free function), filling the temporary string variable, and
feeding the temporary string to printf.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/2183#comment:18>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs