From 0c4fda3ecca3f9b8273cd3d90947e0ca1b50ddc5 Mon Sep 17 00:00:00 2001 From: misaka00251 Date: Tue, 29 Nov 2022 15:22:02 +0800 Subject: [PATCH] Backport patch to fix build with gcc 12 --- 0025-fix-compile-error-with-gcc-12.patch | 45 ++++++++++++++++++++++++ xorg-x11-server.spec | 6 +++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 0025-fix-compile-error-with-gcc-12.patch diff --git a/0025-fix-compile-error-with-gcc-12.patch b/0025-fix-compile-error-with-gcc-12.patch new file mode 100644 index 0000000..674d3bb --- /dev/null +++ b/0025-fix-compile-error-with-gcc-12.patch @@ -0,0 +1,45 @@ +From: misaka00251 +Date: Tue Nov 29 2022 15:09:29 +0800 + +Subject: Backport patch to fix build with gcc 12 + +diff --git a/render/picture.c b/render/picture.c +index a53f3b5..e7aecb2 100644 +--- a/render/picture.c ++++ b/render/picture.c +@@ -867,7 +867,7 @@ CreateSolidPicture(Picture pid, xRenderColor * color, int *error) + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -898,7 +898,7 @@ CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -938,7 +938,7 @@ CreateRadialGradientPicture(Picture pid, xPointFixed * inner, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); +@@ -981,7 +981,7 @@ CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle, + } + + pPicture->id = pid; +- pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); ++ pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(SourcePict)); + if (!pPicture->pSourcePict) { + *error = BadAlloc; + free(pPicture); diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 37b0da7..a8661c2 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -16,7 +16,7 @@ Name: xorg-x11-server Version: 1.20.11 -Release: 12 +Release: 13 Summary: X.Org X11 X server License: MIT and GPLv2 URL: https://www.x.org @@ -81,6 +81,7 @@ Patch0100: 0001-Fix-the-crash-in-shadowUpdatePacked-because-of-memcp.patch Patch0101: 0002-present-Crash-in-present_scmd_get_crtc-and-present_flush.patch Patch0029: xorg-s11-server-CVE-2018-20839.patch +Patch0030: 0025-fix-compile-error-with-gcc-12.patch Patch6000: backport-CVE-2021-4008.patch Patch6001: backport-CVE-2021-4009.patch Patch6002: backport-CVE-2021-4010.patch @@ -437,6 +438,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %{_mandir}/man*/* %changelog +* Tue Nov 29 2022 misaka00251 - 1.20.11-13 +- Backport patch to fix build with gcc 12 + * Fri Nov 18 2022 wangkerong -1.20.11-12 - fix CVE-2022-3551,CVE-2022-3553 -- Gitee