[tor-bugs] #2332 [Tor Relay]: dnsserv_resolved has needless casts, unused strndup.

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Jan 11 13:00:01 UTC 2011


#2332: dnsserv_resolved has needless casts, unused strndup.
-----------------------+----------------------------------------------------
 Reporter:  rransom    |       Owner:                    
     Type:  defect     |      Status:  needs_review      
 Priority:  major      |   Milestone:  Tor: 0.2.1.x-final
Component:  Tor Relay  |     Version:                    
 Keywords:  easy       |      Parent:                    
-----------------------+----------------------------------------------------

Comment(by cypherpunks):

 There are old known broken evdns_server_request_format_response(), so no
 matter.
 {{{
 overflow:
                 j = 512;
                 buf[2] |= 0x02; /* set the truncated bit. */
         }

         req->response_len = (size_t)j;

         if (!(req->response = mm_malloc(req->response_len))) {
                 server_request_free_answers(req);
                 dnslabel_clear(&table);
                 return (-1);
         }
         memcpy(req->response, buf, req->response_len);
 }}}
 Ok it's a truncated bit. What has buf around first 512 bytes, just
 curious?

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


More information about the tor-bugs mailing list