Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.4:Update
xen.30823
libxc-bitmap-longs.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libxc-bitmap-longs.patch of Package xen.30823
From: Olaf Hering <olaf@aepfle.de> Date: Wed, 9 Dec 2020 16:22:14 +0100 Subject: bitmap longs tools: allocate bitmaps in units of unsigned long Allocate enough memory so that the returned pointer can be safely accessed as an array of unsigned long. The actual bitmap size in units of bytes, as returned by bitmap_size, remains unchanged. Signed-off-by: Olaf Hering <olaf@aepfle.de> --- tools/libxc/xc_bitops.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Index: xen-4.14.0-testing/tools/libxc/xc_bitops.h =================================================================== --- xen-4.14.0-testing.orig/tools/libxc/xc_bitops.h +++ xen-4.14.0-testing/tools/libxc/xc_bitops.h @@ -21,7 +21,10 @@ static inline unsigned long bitmap_size( static inline void *bitmap_alloc(unsigned long nr_bits) { - return calloc(1, bitmap_size(nr_bits)); + unsigned long longs; + + longs = (nr_bits + BITS_PER_LONG - 1) / BITS_PER_LONG; + return calloc(longs, sizeof(unsigned long)); } static inline void bitmap_set(void *addr, unsigned long nr_bits)
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