ImageMagick-6.9.4-8差分

ImageMagick-6.9.4-7差分 - yoyaのメモの続き

The latest release of ImageMagick is version 6.9.4-8

まとめ

  • policy で indirect 読み込みの拒否
  • RLE でピクセルオフセットが負の時にヒープオーバーフローするのを修正。
  • ヘッダ取り込みのべき等保証のマクロの先頭に _ をつけてたのを外しました。
    • (例) magick/magick-config.h
18,19c18,19
< #ifndef _MAGICKCORE_MAGICK_CONFIG_H
< #define _MAGICKCORE_MAGICK_CONFIG_H
---
> #ifndef MAGICKCORE_MAGICK_CONFIG_H
> #define MAGICKCORE_MAGICK_CONFIG_H

差分

ChangeLog の分
  • policy で indirect 読み込みの拒否、許可ポリシーを削除、例) convert caption:@mytext.txt ...
    • config/policy.xml
66d65
<       <!-- <policy domain="path" rights="none" pattern="@*" /> -->
67a67
>       <policy domain="path" rights="none" pattern="@*"/>  <!-- indirect reads
  • ピクセルオフセットが 0 未満の時 RLE のチェック ( Craig Young さんによるヒープオーバーフロー報告)
    • coder/rle.c
181d180
<     offset,
185a185
>     offset,
398c398,399
<           if (offset+((size_t) operand*number_planes) > pixel_info_length)
---
>           if ((offset < 0) ||
>               (offset+((size_t) operand*number_planes) > pixel_info_length))
429,430c430,431
<           p=pixels+offset;
<           if (offset+((size_t) operand*number_planes) > pixel_info_length)
---
>           if ((offset < 0) ||
>               (offset+((size_t) operand*number_planes) > pixel_info_length))
436a438
>           p=pixels+offset;

-- coders/pes.c

    • ブロックの中、使用する色パレットの残りの color も初期化。
512a513
>   {
513a515,516
>     blocks[i].color=PESColor;
> 
ChangeLogにない差分
  • coders/label.c
    • label がない時に必要ない処理をスルー
143,144c143,145
<     if (((image->columns == 0) || (image->rows == 0)) ||
<         (fabs(image_info->pointsize) < MagickEpsilon))
---
>     if ((strlen(label) > 0) &&
>         (((image->columns == 0) || (image->rows == 0)) ||
>          (fabs(image_info->pointsize) < MagickEpsilon)))
  • coders/pnm.c
    • パース途中で EOF が来た時の対処。
456a457,458
>             if (EOFBlob(image) != MagickFalse)
>               break;
469a472,473
>           if (EOFBlob(image) != MagickFalse)
>             break;
496a501,502
>             if (EOFBlob(image) != MagickFalse)
>               break;
510a517,518
>           if (EOFBlob(image) != MagickFalse)
>             break;
536a545,546
>             if (EOFBlob(image) != MagickFalse)
>               break;
552a563,564
>           if (EOFBlob(image) != MagickFalse)
>             break;
  • coders/tiff.c
    • 書き込みに失敗した時の異常系処理。
389a390
>   status=MagickTrue;
391c392,393
<     (void) fputc(c,file);
---
>     if (fputc(c,file) != c)
>       status=MagickFalse;
412a415,416
>   if (status == MagickFalse)
>     image=DestroyImage(image);

ChangeLog

2016-06-05  6.9.4-8 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 6.9.4-8, GIT revision 18406:ba4ad2d:20160607.

2016-06-04  6.9.4-8 Cristy  <quetzlzacatenango@image...>
  * Deny indirect reads by policy, remove policy to permit, e.g.,
          convert caption:@mytext.txt ...
  * RLE check for pixel offset less than 0 (heap overflow report from Craig
    Young).
  * Properly initialze PES blocks (reference
    https://github.com/ImageMagick/ImageMagick/issues/213).