X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=inflate.c;fp=inflate.c;h=75353e2d72b50f0fb48d51a5ef6498d324dbf901;hb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;hp=b72c187ee38315c604b236357bee2d33f030f299;hpb=c7e61475680fa226bd9b8bdd469cd66914e630f5;p=debian%2Fgzip diff --git a/inflate.c b/inflate.c index b72c187..75353e2 100644 --- a/inflate.c +++ b/inflate.c @@ -1,6 +1,7 @@ /* Inflate deflated data - Copyright (C) 1997-1999, 2002, 2006, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-1999, 2002, 2006, 2009-2010 Free Software Foundation, + Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -117,9 +118,7 @@ #include #include "tailor.h" -#if defined STDC_HEADERS || defined HAVE_STDLIB_H -# include -#endif +#include #include "gzip.h" #define slide window @@ -590,7 +589,8 @@ int bl, bd; /* number of bits decoded by tl[] and td[] */ do { n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); #if !defined(NOMEMCPY) && !defined(DEBUG) - if (w - d >= e) /* (this test assumes unsigned comparison) */ + unsigned int delta = w > d ? w - d : d - w; + if (delta >= e) { memcpy(slide + w, slide + d, e); w += e;