Opened 2 years ago

Last modified 5 weeks ago

#21494 new defect

Fix scan-build warnings about assigning to char**

Reported by: teor Owned by:
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Minor Keywords: clang scan-build technical-debt c-standard
Cc: Actual Points:
Parent ID: #30225 Points: 0.2
Reviewer: Sponsor:

Description (last modified by teor)

scan-build complains about:
tor_check_port_forwarding:

const char **argv; /* cli arguments */
...
argv = tor_calloc(args_n, sizeof(char *));

and:
process_environment_make:

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.

Child Tickets

Change History (4)

comment:1 Changed 2 years ago by teor

Description: modified (diff)

comment:2 Changed 23 months ago by nickm

Keywords: technical-devt c-standard added

comment:3 Changed 23 months ago by nickm

Keywords: technical-debt added; technical-devt removed

comment:4 Changed 5 weeks ago by teor

Parent ID: #30225
Note: See TracTickets for help on using tickets.