mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
perf record: Fix possible incorrect free in record__switch_output()
[ Upstream commitaff10a1652
] perf_data__switch() may not assign a legal value to 'new_filename'. In this case, 'new_filename' uses the on-stack value, which may cause a incorrect free and unexpected result. Fixes:03724b2e9c
("perf record: Allow to limit number of reported perf.data files") Signed-off-by: Yang Jihong <yangjihong1@huawei.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20240119040304.3708522-2-yangjihong1@huawei.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a0188ea3dc
commit
27ee265043
1 changed files with 1 additions and 1 deletions
|
@ -1830,8 +1830,8 @@ static int
|
|||
record__switch_output(struct record *rec, bool at_exit)
|
||||
{
|
||||
struct perf_data *data = &rec->data;
|
||||
char *new_filename = NULL;
|
||||
int fd, err;
|
||||
char *new_filename;
|
||||
|
||||
/* Same Size: "2015122520103046"*/
|
||||
char timestamp[] = "InvalidTimestamp";
|
||||
|
|
Loading…
Reference in a new issue