ImageMagick/CVE-2022-32547.patch
starlet-dx 0abdc1d4f5 Fix CVE-2022-32547
(cherry picked from commit 262428f70ef10dbb0662b45eaf8f46090c1337e0)
2022-11-22 19:37:20 +08:00

44 lines
1.6 KiB
Diff

From eac8ce4d873f28bb6a46aa3a662fb196b49b95d0 Mon Sep 17 00:00:00 2001
From: xiaoxiaoafeifei <lliangliang2007@163.com>
Date: Sat, 9 Apr 2022 20:34:03 +0800
Subject: [PATCH] fix #5033: runtime error: load of misaligned address (#5034)
* fix Division by zero in XMenuWidget() of MagickCore/widget.c
* Fix memory leak in AnimateImageCommand() of MagickWand/animate.c and DisplayImageCommand() of MagickWand/display.c
* fix Division by zero in ReadEnhMetaFile() of coders/emf.c
* Resolve conflicts
* fix issue: outside the range of representable values of type 'unsigned char' at coders/psd.c:1025
* fix error: 4e+26 is outside the range of representable values of type 'unsigned long' at coders/pcl.c:299
* fix #5033:runtime error: load of misaligned address
Co-authored-by: zhailiangliang <zhailiangliang@loongson.cn>
---
MagickCore/property.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MagickCore/property.c b/MagickCore/property.c
index 8175dd1f73..6e72cac157 100644
--- a/MagickCore/property.c
+++ b/MagickCore/property.c
@@ -1545,12 +1545,12 @@ static MagickBooleanType GetEXIFProperty(const Image *image,
}
case EXIF_FMT_SINGLE:
{
- EXIFMultipleValues(4,"%f",(double) *(float *) p1);
+ EXIFMultipleValues(4,"%f",(double)ReadPropertySignedLong(endian,p1));
break;
}
case EXIF_FMT_DOUBLE:
{
- EXIFMultipleValues(8,"%f",*(double *) p1);
+ EXIFMultipleValues(8,"%f",(double)ReadPropertySignedLong(endian,p1));
break;
}
case EXIF_FMT_STRING: