Re: [PATCH spice-common] region: Avoid possible memory corruption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> Ack,
> Pavel
> 
> btw Has pixman some api documentation ?
> 

I didn't find much, had to look at the sources.
This function is not called much apparently (mainly in streaming
code) but I'm quite surprised it didn't trigger something
worst than a leak!
Looks like Valgrind got too slow recently.

Frediano

> On Tue, 2017-02-28 at 14:53 +0000, Frediano Ziglio wrote:
> > 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@xxxxxxxxxx>
> > ---
> >  common/region.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > 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,
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]