bug-gzip
[Top][All Lists]
Advanced

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

RE: gzip use of memcpy


From: Alain Magloire
Subject: RE: gzip use of memcpy
Date: Fri, 8 Jan 2010 13:34:00 -0500

> > Index: inflate.c
> ...
> >          if (w - d >= e)
> >          {
> > -          memcpy(slide + w, slide + d, e);
> > +          memmove(slide + w, slide + d, e);
> 
> Can you give sample values of w, d and e for which this change
> makes a difference?  Doesn't the preceding (w - d >= e) guard
> ensure that the source and destination buffers never overlap?
>

According to our tester:

The w==16316
    d==16322
    w-d == -6  // <-- Unsigned
 
The bad file is an attachment; you could override the memcpy(3)
implementation with one checking for overlap for example.


Thanks

Attachment: sella1.tar.gz
Description: sella1.tar.gz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]