[tor-bugs] #21494 [Core Tor/Tor]: Fix scan-build warnings about assigning to char**

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Feb 18 02:39:11 UTC 2017


#21494: Fix scan-build warnings about assigning to char**
------------------------------+------------------------------
     Reporter:  teor          |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Low           |  Milestone:  Tor: unspecified
    Component:  Core Tor/Tor  |    Version:
     Severity:  Minor         |   Keywords:  clang scan-build
Actual Points:                |  Parent ID:
       Points:  0.2           |   Reviewer:
      Sponsor:                |
------------------------------+------------------------------
 scan-build complains about:
 {{{
 const char **argv; /* cli arguments */
 ...
 argv = tor_calloc(args_n, sizeof(char *));
 }}}
 and
 {{{
 process_environment_t *env =
 tor_malloc_zero(sizeof(process_environment_t));
 ...
 env->unixoid_environment_block = tor_calloc(n_env_vars + 1, sizeof(char
 *));
 }}}

 This is fine, and maybe there's a cast or magic comment we could use to
 make the warnings go away.

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


More information about the tor-bugs mailing list