[tor-bugs] #13398 [Applications/Tor Browser]: at startup, browser gleans user FULL NAME (real name, given name) from O/S

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jul 26 19:48:00 UTC 2017


#13398: at startup, browser gleans user FULL NAME (real name, given name) from O/S
--------------------------------------+--------------------------------
 Reporter:  zinc                      |          Owner:  pospeselr
     Type:  defect                    |         Status:  needs_revision
 Priority:  Medium                    |      Milestone:
Component:  Applications/Tor Browser  |        Version:
 Severity:  Normal                    |     Resolution:
 Keywords:  TorBrowserTeam201707R     |  Actual Points:
Parent ID:                            |         Points:
 Reviewer:                            |        Sponsor:
--------------------------------------+--------------------------------

Comment (by pospeselr):

 Thanks for the feedback!

 In regards to the ToNewUnicode() call, it looks like you are completely
 correct!  Not only is it less C++ code but the generated machine code is
 shorter too: https://godbolt.org/g/hyurar

 Generated code for when that link eventually dies (gcc version 7.1 with
 -03):
 {{{
 ; int func_local(void** aPtr)
 ; {
 ;         if(!aPtr)
 ;         {
 ;                 return FAILURE;
 ;         }
 ;         auto ptr = get_ptr();
 ;         if(ptr)
 ;         {
 ;                 *aPtr = ptr;
 ;                 return SUCCESS;
 ;         }
 ;         *aPtr = nullptr;
 ;         return FAILURE;
 ; }
 func_local(void**):
         test    rdi, rdi
         je      .L7
         push    rbx
         mov     rbx, rdi
         call    get_ptr()
         test    rax, rax
         je      .L6
         mov     QWORD PTR [rbx], rax
         xor     eax, eax
         pop     rbx
         ret
 .L7:
         mov     eax, -1
         ret
 .L6:
         mov     QWORD PTR [rbx], 0
         mov     eax, -1
         pop     rbx
         ret

 ; int func_ptr(void** aPtr)
 ; {
 ;         if(!aPtr)
 ;         {
 ;                 return FAILURE;
 ;         }
 ;         *aPtr = get_ptr();
 ;         if(*aPtr)
 ;         {
 ;                 return SUCCESS;
 ;         }
 ;         return FAILURE;
 ; }
 func_ptr(void**):
         test    rdi, rdi
         je      .L14
         push    rbx
         mov     rbx, rdi
         call    get_ptr()
         test    rax, rax
         mov     QWORD PTR [rbx], rax
         sete    al
         movzx   eax, al
         neg     eax
         pop     rbx
         ret
 .L14:
         mov     eax, -1
         ret
 }}}

 I can go through another round, fix these issues, and upload a new patch
 if you like (while disabling sublime's 'trim trailing white-space'
 option).

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


More information about the tor-bugs mailing list