Re: [PATCH 2/2] Fix stack-use-after-scope error reported by ASAN by GCC 7.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Martin,

On Thu, 6 Apr 2017, Martin Liška wrote:

> Following patch fixes issues that can be seen with -fsanitize=address on
> GCC 7.

Good catch.

However, it may make more sense to switch to using the "args" field
instead of the "argv" field: it is of type "struct argv_array" and is
released automagically by finish_command().

In other words, you would use something like

@@ -600,7 +601,8 @@ static struct cmd2process
*start_multi_file_filter(struct hashmap *hashmap, cons
        process = &entry->process;

        child_process_init(process);
-       process->argv = argv;
+	argv_array_push(&process->args, cmd);

instead, making even for a nice LOC reduction.

Ciao,
Johannes

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]