[tor-bugs] #15546 [Tor]: handle_control_postdescriptor() modifies a const char

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Apr 1 19:51:32 UTC 2015


#15546: handle_control_postdescriptor() modifies a const char
---------------------+---------------------
 Reporter:  donncha  |          Owner:
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:
Component:  Tor      |        Version:
 Keywords:           |  Actual Points:
Parent ID:           |         Points:
---------------------+---------------------
 `handle_control_postdescriptor()` in src/or/control.c modifies the const
 char body. This is a pretty bad practice and might causes errors with non
 writable memory segments.

 {{{
 static int handle_control_postdescriptor(control_connection_t *conn,
                                          uint32_t len, const char *body) {
     char *cp = memchr(body, '\n', len);
     smartlist_t *args = smartlist_new();
     tor_assert(cp);*cp++ = '\0';
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15546>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list