]> git.imager.perl.org - imager.git/commitdiff
he unpack code for ICO/CUR file handling could extend 32-bit unsigned values to 64...
authorTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 08:19:56 +0000 (19:19 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 08:19:56 +0000 (19:19 +1100)
Changes
ICO/ICO.pm
ICO/msicon.c

diff --git a/Changes b/Changes
index dc885fa93eff19d94b20807a91ebc29843bdc4c7..cc369951da2edc3ecf7f770edad7e969c5a27359 100644 (file)
--- a/Changes
+++ b/Changes
@@ -75,6 +75,10 @@ High severity:
  - avoid an unneeded EXTEND() call when the FT2 has_chars()
    implementation returns 0. CID 185292.
 
  - avoid an unneeded EXTEND() call when the FT2 has_chars()
    implementation returns 0. CID 185292.
 
+ - the unpack code for ICO/CUR file handling could extend 32-bit
+   unsigned values to 64-bit signed.  I believe this is harmless. CID
+   185319.
+
 Imager 1.008 - 31 Dec 2018
 ============
 
 Imager 1.008 - 31 Dec 2018
 ============
 
index 67d2772f3f0ccaeae42e57d51ac32050f2c9d752..c560a57fd8785f0d4a3cbaeb0bdbcf5da609700b 100644 (file)
@@ -4,7 +4,7 @@ use Imager;
 use vars qw($VERSION @ISA);
 
 BEGIN {
 use vars qw($VERSION @ISA);
 
 BEGIN {
-  $VERSION = "0.05";
+  $VERSION = "0.06";
   
   require XSLoader;
   XSLoader::load('Imager::File::ICO', $VERSION);
   
   require XSLoader;
   XSLoader::load('Imager::File::ICO', $VERSION);
index 85e3e28438b862958fa015e967a4090bf49f004f..327f306bb391e934a39f3eae3914ff6a1c52b239 100644 (file)
@@ -696,7 +696,7 @@ int read_packed(io_glue *ig, const char *format, ...) {
 
     case 'd':
       p = va_arg(ap, long *);
 
     case 'd':
       p = va_arg(ap, long *);
-      *p = bufp[0] + (bufp[1] << 8) + (bufp[2] << 16) + (bufp[3] << 24);
+      *p = bufp[0] + (bufp[1] << 8) + (bufp[2] << 16) + ((unsigned long)bufp[3] << 24);
       bufp += 4;
       break;
 
       bufp += 4;
       break;