#25055: string_is_valid_hostname() returns true for IPv4 addresses
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.3.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.3.2.1-alpha
 Severity:  Normal                               |     Resolution:
 Keywords:  IPv6, IPv4, tor-dns, 032-backport,   |  Actual Points:
  033-must                                       |
Parent ID:  #25036                               |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by nickm):

 {{{
    size_t len = strlen(string);

 -  tor_assert(string);
 -  tor_assert(len > 0);
 +  if (string == NULL)
 +    return 0;
 +
 +  len = strlen(string);
 }}}

 Looks like you're doing strlen(string) before you check it for NULL, and
 after.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25055#comment:23>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Reply via email to