Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
blktrace
blkparse-fix-incorrectly-sized-memset-in-check_...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File blkparse-fix-incorrectly-sized-memset-in-check_cpu_m.patch of Package blktrace
From: Jeff Mahoney <jeffm@suse.com> Date: Thu, 21 Oct 2021 10:06:40 -0400 Subject: [PATCH 2/2] blkparse: fix incorrectly sized memset in check_cpu_map References: bsc#1191788 Git-repo: http://git.kernel.dk/blktrace.git Git-commit: 7f5d2c5173d72018aa29c583c9291ef10abaf8df The memset call in check_cpu_map always clears sizeof(unsigned long *) regardless of what size was allocated. Use calloc instead to allocate the map so it's zeroed properly regardless of the size requested. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> --- blkparse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blkparse.c b/blkparse.c index 498857c..9d2029a 100644 --- a/blkparse.c +++ b/blkparse.c @@ -2236,8 +2236,7 @@ static int check_cpu_map(struct per_dev_info *pdi) /* * create a map of the cpus we have traces for */ - cpu_map = malloc(pdi->cpu_map_max / sizeof(long)); - memset(cpu_map, 0, sizeof(*cpu_map)); + cpu_map = calloc(1, pdi->cpu_map_max / sizeof(long)); n = rb_first(&rb_sort_root); while (n) { __t = rb_entry(n, struct trace, rb_node); -- 2.33.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor