GCC 14 compatibility fixes

Drop netpbm-cmuwtopbm.patch because of an out-of-bounds stack write.
This is correctly reported by GCC 14 as a type error.

It looks like the issue was fixed upstream by adding an (uint32_t)
cast to the magic number check a few lines below (not shown in
the patch added in commit 7d3e28cc83 downsteam).

Also stub out converter/other/jpeg2000/libjasper_compat.c because
it is broken.  Fixes another GCC 14 compatibility issue.
This commit is contained in:
Florian Weimer 2024-01-21 21:35:45 +01:00
parent 8d07cd0c64
commit 2b6ee3cbff
3 changed files with 48 additions and 23 deletions

41
netpbm-c99-2.patch Normal file
View File

@ -0,0 +1,41 @@
Remove the contents of libjasper_compat.c. The assignment
*errorP = errorP;
is bogus because it creates a non-null value in *errorP even on
success, and the caller expects a null pointer int his case.
The source file is compiled, but not actually linked in, so this is
only a problem because of the type error that fails the build.
diff --git a/converter/other/jpeg2000/libjasper_compat.c b/converter/other/jpeg2000/libjasper_compat.c
index 101820a321212dc6..e69de29bb2d1d643 100644
--- a/converter/other/jpeg2000/libjasper_compat.c
+++ b/converter/other/jpeg2000/libjasper_compat.c
@@ -1,26 +0,0 @@
-#include "netpbm/nstring.h"
-
-#include "jasper/jasper.h"
-#include "jasper/jas_image.h"
-
-#ifndef JAS_HAVE_PMJAS_IMAGE_DECODE
-
-void
-pmjas_image_decode(jas_stream_t * const in,
- int const fmtArg,
- const char * const optstr,
- jas_image_t ** const imagePP,
- const char ** const errorP) {
-
- jas_image_t * const jasperP = jas_image_decode(in, fmtArg, optstr);
-
- if (jasperP) {
- *imagePP = jasperP;
- *errorP = errorP;
- } else {
- pm_asprintf(errorP, "Failed. Details may have been written to "
- "Standard Error");
- }
-}
-
-#endif

View File

@ -1,21 +0,0 @@
diff -up netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix netpbm-10.61.01/converter/pbm/cmuwmtopbm.c
--- netpbm-10.61.01/converter/pbm/cmuwmtopbm.c.cmuwtopbmfix 2013-01-02 18:39:57.000000000 +0100
+++ netpbm-10.61.01/converter/pbm/cmuwmtopbm.c 2013-01-03 05:41:36.024984241 +0100
@@ -18,7 +18,7 @@
This program does not check the pad bits at the end of each row.
*/
-
+#include <stdint.h>
#include "pbm.h"
/*--------------------------
@@ -42,7 +42,7 @@ readCmuwmHeader(FILE * const ifP
"CMU window manager header EOF / read error";
uint32_t const cmuwmMagic = 0xf10040bb;
- long l;
+ uint32_t l;
short s;
int rc;

View File

@ -1,7 +1,7 @@
Summary: A library for handling different graphics file formats
Name: netpbm
Version: 11.02.00
Release: 4%{?dist}
Release: 5%{?dist}
# See copyright_summary for details
License: BSD and GPLv2 and IJG and MIT and Public Domain
URL: http://netpbm.sourceforge.net/
@ -24,12 +24,12 @@ Patch9: netpbm-xwdfix.patch
Patch10: netpbm-multilib.patch
Patch11: netpbm-glibc.patch
Patch12: netpbm-docfix.patch
Patch13: netpbm-cmuwtopbm.patch
Patch14: netpbm-pamtojpeg2k.patch
Patch15: netpbm-manfix.patch
Patch16: netpbm-jasper.patch
Patch17: netpbm-libdir-so.patch
Patch18: netpbm-c99.patch
Patch19: netpbm-c99-2.patch
BuildRequires: make
BuildRequires: libjpeg-devel, libpng-devel, libtiff-devel, flex, gcc, jbigkit-devel
@ -230,6 +230,11 @@ popd
%doc userguide/*
%changelog
* Sun Jan 21 2024 Florian Weimer <fweimer@redhat.com> - 11.02.00-5
- GCC 14 compatibility fixes:
Drop netpbm-cmuwtopbm.patch to fix an out-of-bounds stack write (#2259450)
Stub out unused converter/other/jpeg2000/libjasper_compat.c (#2259448)
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 11.02.00-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild