public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Sandro Mani <manisandro@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mingw-cfitsio] rawhide: Backport fix for CVE-2026-115504
Date: Sun, 25 Oct 2026 11:00:43 GMT	[thread overview]
Message-ID: <179292604327.1.12309904017758546883.rpms-mingw-cfitsio-df5164b96fa1@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/mingw-cfitsio
Branch : rawhide
Commit : df5164b96fa1be07cf8690b6299b50f445fe9a63
Author : Sandro Mani <manisandro@gmail.com>
Date   : 2026-10-25T12:00:31+01:00
Stats  : +83/-1 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/mingw-cfitsio/c/df5164b96fa1be07cf8690b6299b50f445fe9a63?branch=rawhide

Log:
Backport fix for CVE-2026-115504

---
diff --git a/579792e0f85bff0c6733ad5ebdf54c3b5c188686.patch b/579792e0f85bff0c6733ad5ebdf54c3b5c188686.patch
new file mode 100644
index 0000000..420ef8a
--- /dev/null
+++ b/579792e0f85bff0c6733ad5ebdf54c3b5c188686.patch
@@ -0,0 +1,80 @@
+diff -rupN cfitsio-4.7.0/getcols.c cfitsio-4.7.0-new/getcols.c
+--- cfitsio-4.7.0/getcols.c	2026-08-05 16:41:02.000000000 +0200
++++ cfitsio-4.7.0-new/getcols.c	2026-10-25 11:48:54.884853770 +0100
+@@ -914,6 +914,16 @@ int ffgcls2 ( fitsfile *fptr,   /* I - F
+       readptr = startpos + ((LONGLONG)rownum * rowlen) + (elemnum * incre);
+       ffmbyt(fptr, readptr, REPORT_EOF, status);  /* move to read position */
+ 
++      if (twidth < 1 || ntodo < 1 ||
++          (size_t) ntodo > sizeof(cbuff) / (size_t) twidth)
++      {
++         snprintf(message, FLEN_ERRMSG,
++                "Out-of-bounds string read: %ld strings of width %ld (ffgcls2)",
++                ntodo, twidth);
++         ffpmsg(message);
++         return(*status = READ_ERROR);
++      }
++
+       /* read the array of strings from the FITS file into the buffer */
+ 
+       if (incre == twidth)
+@@ -995,4 +1005,3 @@ int ffgcls2 ( fitsfile *fptr,   /* I - F
+ 
+     return(*status);
+ }
+-
+diff -rupN cfitsio-4.7.0/tests/test_getcols.c cfitsio-4.7.0-new/tests/test_getcols.c
+--- cfitsio-4.7.0/tests/test_getcols.c	2026-08-05 16:41:02.000000000 +0200
++++ cfitsio-4.7.0-new/tests/test_getcols.c	2026-10-25 11:48:54.885223463 +0100
+@@ -122,6 +122,43 @@ test_read_variable_length_string(void)
+ }
+ 
+ static void
++test_read_oversized_variable_length_string(void)
++{
++	fitsfile *f;
++	int status = 0;
++	char *ttype[] = { "VARSTR" };
++	char *tform[] = { "1PA" };
++	unsigned char *data;
++	char *result;
++	char *results[1];
++	int anynull;
++	size_t ii;
++
++	data = malloc(28801);
++	result = malloc(28802);
++	fail_if(data == NULL || result == NULL);
++	for (ii = 0; ii < 28801; ii++)
++		data[ii] = 'A';
++	results[0] = result;
++
++	call_02(ffinit, &f, "!" test_path);
++	call_04(ffphps, f, BYTE_IMG, 0, NULL);
++	call_08(ffcrtb, f, BINARY_TBL, 1, 1, ttype, tform, NULL, NULL);
++	call_06(ffpclb, f, 1, 1, 1, 28801, data);
++	call_01(ffclos, f);
++
++	call_03(ffopen, &f, test_path, READONLY);
++	call_03(ffmahd, f, 2, NULL);
++	ffgcvs(f, 1, 1, 1, 1, NULL, results, &anynull, &status);
++	fail_if(status == 0);
++	status = 0;
++	call_01(ffclos, f);
++
++	free(data);
++	free(result);
++}
++
++static void
+ test_read_numeric_as_string(void)
+ {
+ 	fitsfile *f;
+@@ -451,6 +488,7 @@ main(void)
+ 	test_read_short_as_string();
+ 	test_read_string_column_with_null_flags();
+ 	test_read_longlong_as_string();
++	test_read_oversized_variable_length_string();
+ 	test_get_column_display_width();
+ 	test_get_column_display_width_with_tdisp();
+ 	test_get_column_display_width_bad_col();

diff --git a/cfitsio_cmake.patch b/cfitsio_cmake.patch
index 4ed5143..a7b5284 100644
--- a/cfitsio_cmake.patch
+++ b/cfitsio_cmake.patch
@@ -1,6 +1,6 @@
 diff -rupN --no-dereference cfitsio-4.7.0/CMakeLists.txt cfitsio-4.7.0-new/CMakeLists.txt
 --- cfitsio-4.7.0/CMakeLists.txt	2026-08-05 16:41:02.000000000 +0200
-+++ cfitsio-4.7.0-new/CMakeLists.txt	2026-08-16 11:12:47.321090941 +0200
++++ cfitsio-4.7.0-new/CMakeLists.txt	2026-10-25 11:48:54.848333803 +0100
 @@ -301,7 +301,7 @@ install(TARGETS cfitsio EXPORT cfitsioTa
  )
  

diff --git a/mingw-cfitsio.spec b/mingw-cfitsio.spec
index b370ec7..2e31679 100644
--- a/mingw-cfitsio.spec
+++ b/mingw-cfitsio.spec
@@ -14,6 +14,8 @@ URL:           https://heasarc.gsfc.nasa.gov/fitsio/
 Source0:       https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/%{pkgname}-%{version}.tar.gz
 # Install headers to include/cfitsio
 Patch0:        cfitsio_cmake.patch
+# Backport fix for CVE-2026-115504
+Patch1:        https://github.com/HEASARC/cfitsio/commit/579792e0f85bff0c6733ad5ebdf54c3b5c188686.patch
 
 BuildRequires: make
 BuildRequires: cmake

                 reply	other threads:[~2026-10-25 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179292604327.1.12309904017758546883.rpms-mingw-cfitsio-df5164b96fa1@fedoraproject.org \
    --to=manisandro@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox