Re: com php-src: Fixed bug #66242 (don't assume char is signed): ext/fileinfo/libmagic/apprentice.c

From: Date: Wed, 24 Sep 2014 07:47:48 +0000
Subject: Re: com php-src: Fixed bug #66242 (don't assume char is signed): ext/fileinfo/libmagic/apprentice.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81897@lists.php.net to get a copy of this message
On Sun, Sep 21, 2014 at 1:39 AM, Ard Biesheuvel <ardbiesheuvel@php.net> wrote: > Commit: e64da8c20df3ec28bd2417924b207b870e9ab99f > Author: Ard Biesheuvel <ard.biesheuvel@linaro.org> Sat, 20 Sep > 2014 16:32:31 -0700 > Parents: 00525b824af4265e7fc74d3655a04da9c4c667f7 > Branches: PHP-5.4 PHP-5.5 PHP-5.6 master > > Link: > ÄÈs29dX > Mƒâ{r%http://git.php.net/?p=php-src.git;a=commitdiff;h=e64da8c20df3ec28bd2417924b207b870e9ab99f > > Log: > Fixed bug #66242 (don't assume char is signed) > > This fixes a bug in libmagic where a cast to 'char' is assumed to result > in sign extension to occur. However, unqualified 'char' is unsigned on > architectures such as ARM, so the cast needs to be to 'signed char' > explicitly. > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> > > Bugs: > https://bugs.php.net/66242 > > Changed paths: > M ext/fileinfo/libmagic/apprentice.c > > > Diff: > diff --git a/ext/fileinfo/libmagic/apprentice.c > b/ext/fileinfo/libmagic/apprentice.c > index fd82564..b137405 100644 > --- a/ext/fileinfo/libmagic/apprentice.c > +++ b/ext/fileinfo/libmagic/apprentice.c > @@ -1269,7 +1269,7 @@ file_signextend(struct magic_set *ms, struct magic > *m, uint64_t v) > * the sign extension must have happened. > */ > case FILE_BYTE: > - v = (char) v; > + v = (signed char) v; > break; > case FILE_SHORT: > case FILE_BESHORT: > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > hi, you forgot to add an entry to the NEWS file for this, could you fix that? -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.cvs (#81897) next »