[tor-bugs] #22789 [Core Tor/Tor]: Tor 0.3.1.4-alpha crash on OpenBSD-current

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jul 4 07:52:13 UTC 2017


#22789: Tor 0.3.1.4-alpha crash on OpenBSD-current
-------------------------------------------------+-------------------------
 Reporter:  fredzupy                             |          Owner:
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  High                                 |      Milestone:  Tor:
                                                 |  0.3.1.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.3.1.4-alpha
 Severity:  Major                                |     Resolution:
 Keywords:  tor crash inet_pton c99 openbsd      |  Actual Points:
  024-backport 025-backport 026-backport         |
  027-backport 028-backport 029-backport         |
  030-backport                                   |
Parent ID:                                       |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by fredzupy):

 Replying to [comment:17 catalyst]:
 > My reading of C99 is that `strtol("0xquux", &next, 16)` must return zero
 and `next` must point to the `x`.  The optionality in paragraph 3 is for
 the input data, not the implementation.

 In order to clarify a little bit, because it was not obvious for me to
 understand, the following code have different behaviour under different
 system:
 {{{
 #include <limits.h>
 #include <stdlib.h>
 #include <stdio.h>

 int
 main()
 {
         long l;
         char *rest;

         l = strtol("0xquux", &rest, 16);
         printf("l:%ld rest:%s\n", l, rest);

         return 0;
 }
 }}}

 Under Linux produce:
 l:0 rest:xquux

 Under OpenBSD produce:
 l:0 rest:0xquux

 The question is to know if the Tor code is good enough and OpenBSD need to
 fix something or OpenBSD is sufficiently conformant and the Tor code need
 to adapt.

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


More information about the tor-bugs mailing list