Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/cfitsio/files: cfitsio-3.100-null-protect.patch
Date: Sat, 31 Jan 2009 12:39:40
Message-Id: E1LTF8L-0007IJ-CY@stork.gentoo.org
1 bicatali 09/01/31 12:39:37
2
3 Added: cfitsio-3.100-null-protect.patch
4 Log:
5 Added protection against null pointer dereferences, thanks to Paul Price, bug #256681
6 (Portage version: 2.2_rc23/cvs/Linux x86_64)
7
8 Revision Changes Path
9 1.1 sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/cfitsio/files/cfitsio-3.100-null-protect.patch?rev=1.1&content-type=text/plain
13
14 Index: cfitsio-3.100-null-protect.patch
15 ===================================================================
16 diff -Naur cfitsio.orig/edithdu.c cfitsio/edithdu.c
17 --- cfitsio.orig/edithdu.c 2009-01-31 12:30:07.196101165 +0000
18 +++ cfitsio/edithdu.c 2009-01-31 12:32:03.467511681 +0000
19 @@ -556,7 +556,9 @@
20 return(*status);
21
22 extnm[0] = '\0';
23 - strncat(extnm, extnmx, FLEN_VALUE-1);
24 + if (extnmx) {
25 + strncat(extnm, extnmx, FLEN_VALUE-1);
26 + }
27
28 if (fptr->HDUposition != (fptr->Fptr)->curhdu)
29 ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
30 @@ -692,7 +694,9 @@
31 return(*status);
32
33 extnm[0] = '\0';
34 - strncat(extnm, extnmx, FLEN_VALUE-1);
35 + if (extnmx) {
36 + strncat(extnm, extnmx, FLEN_VALUE-1);
37 + }
38
39 if (fptr->HDUposition != (fptr->Fptr)->curhdu)
40 ffmahd(fptr, (fptr->HDUposition) + 1, NULL, status);
41 diff -Naur cfitsio.orig/putkey.c cfitsio/putkey.c
42 --- cfitsio.orig/putkey.c 2009-01-31 12:30:07.220108134 +0000
43 +++ cfitsio/putkey.c 2009-01-31 12:32:49.566075447 +0000
44 @@ -2729,7 +2729,9 @@
45 }
46
47 xtension[0] = '\0';
48 - strncat(xtension, xtensionx, FLEN_VALUE-1);
49 + if (xtensionx) {
50 + strncat(xtension, xtensionx, FLEN_VALUE-1);
51 + }
52
53 ffpkys(fptr, "XTENSION", xtension, "extension type", status);
54 ffpkyj(fptr, "BITPIX", bitpix, "number of bits per data pixel", status);