mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-08 09:18:08 +00:00
region: Avoid possible memory corruption
pixman_region32_copy assume that destination (first argument) is initialized and can use a pointer inside based on different conditions. As intersection is not initialized this can cause different memory problems. This resulted in memory leak detection from address sanitizer. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
parent
ab7cae45bc
commit
4423ea5d2a
@ -452,6 +452,7 @@ void region_xor(QRegion *rgn, const QRegion *other_rgn)
|
||||
{
|
||||
pixman_region32_t intersection;
|
||||
|
||||
pixman_region32_init(&intersection);
|
||||
pixman_region32_copy(&intersection, rgn);
|
||||
pixman_region32_intersect(&intersection,
|
||||
&intersection,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user