[Spice-commits] common/region.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Feb 28 15:27:24 UTC 2017


 common/region.c |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 4423ea5d2ad5596533dddf83ac1c11660c9e0ca4
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Tue Feb 28 14:53:11 2017 +0000

    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 at redhat.com>
    Acked-by: Pavel Grunt <pgrunt at redhat.com>

diff --git a/common/region.c b/common/region.c
index 14a27ed..e9abb32 100644
--- a/common/region.c
+++ b/common/region.c
@@ -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,


More information about the Spice-commits mailing list