From 9c776b072af1d58e55e9eb04da4ce9cb2de76772 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 26 Feb 2025 07:09:30 +0100 Subject: [PATCH] Tweak AdditionOverflowInLoaderExifJpeg for 32bit unsigned char OSes Last-Update: 2023-07-16 Forwarded: not-needed AdditionOverflowInLoaderExifJpeg expects an overflow to happen on 32bit architectures; due to the way LoaderExifJpeg & StringValueBase work and the test data is fabricated, the overflow happens only architectures with signed char. Tweak AdditionOverflowInLoaderExifJpeg to account for this, by not expecting an overflow in case the architecture has unsigned char (e.g. ARM and POWER). For more discussion and notes, see: https://github.com/Exiv2/exiv2/issues/933 Gbp-Pq: Name tests-overflow-skip-unsigned-char-23bit.diff --- tests/bugfixes/github/test_CVE_2018_12265.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/bugfixes/github/test_CVE_2018_12265.py b/tests/bugfixes/github/test_CVE_2018_12265.py index 50d74b5..e98ddb8 100644 --- a/tests/bugfixes/github/test_CVE_2018_12265.py +++ b/tests/bugfixes/github/test_CVE_2018_12265.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import platform + import system_tests class AdditionOverflowInLoaderExifJpeg(metaclass=system_tests.CaseMeta): @@ -17,6 +19,6 @@ class AdditionOverflowInLoaderExifJpeg(metaclass=system_tests.CaseMeta): Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored. Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored. """ + - ("" if system_tests.BT.Config.is_64bit else "Uncaught exception: Overflow in addition\n") + ("" if system_tests.BT.Config.is_64bit or any(i for i in ["arm", "ppc"] if i in platform.uname().machine) else "Uncaught exception: Overflow in addition\n") ] - retval = [0 if system_tests.BT.Config.is_64bit else 1] + retval = [0 if system_tests.BT.Config.is_64bit or any(i for i in ["arm", "ppc"] if i in platform.uname().machine) else 1] -- 2.30.2