Re: [PATCH] trace-cmd record: Use copy of PATH for strtok_r() operations

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

 



On Tue, Nov 28, 2023 at 03:30:24PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx>
> 
> As strtok_r() modifies the string it is parsing, using the environment variable
> PATH to find the paths for execution causes it to be truncated when reused by
> exec. Instead, make a copy of the PATH environment variable to use to parse the
> paths.
> 
> I had this fixed in my repo for some time and never pushed it out, but it was
> eventually reported by others.
> 
> Link: https://lore.kernel.org/all/20231128192435.36507-1-void@xxxxxxxxxxxxx/
> 
> Reported-by: David Vernet <void@xxxxxxxxxxxxx>
> Fixes: edf9424029cc ("trace-cmd: Open code execvp routine to avoid multiple execve syscalls")
> Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx>

Reviewed-by: David Vernet <void@xxxxxxxxxxxxx>




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux